This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Queue Implementation In C Using Array ! | |
#include<stdio.h> | |
#include<stdlib.h> // hearder for for using exit and return function | |
#define max 5 // symbolic constant | |
int rear=-1,front=-1; // global variable | |
int queue[max]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ceiling and floor a number without using library function's */ | |
#include<stdio.h> | |
int CEIL(double v) | |
{ | |
if(v-(int)v==0) // check weather the float variable contains a integer value or not // | |
return v; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution was written for | |
* the following equation | |
* f(x) = x^3 - 0.165x^2 + 3.993 * 10^-4 | |
You need an absolute relative approximate error of 5% or less. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
@Author: Nasir Islam Sujan | |
@Github: https://github.com/78526Nasir | |
*/ | |
/* | |
* False Position Method | |
* This solution is for the following equation | |
* f(x)=(x-4)^2(x+2)=0 | |
* given initial guesses xL=-2.5, xU=-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Round Robin CPU scheduling algorithm implementation in C! | |
#include<stdio.h> | |
#define max 20 // maximum size for array | |
main() | |
{ | |
int i,burstTime[max],remainTime[max],remainProcess,arrivalTime[max],totalExecutionTime=0,timeQuantum,flag=0,n; | |
float totalWaitingTime=0; | |
printf("Enter the Number of Process(max 20) : "); | |
scanf("%d",&n); // n is the number of Process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Circular Queue Implementation in C using Array ! | |
#include<stdio.h> | |
#include<stdlib.h> //header file for using return and exit function | |
#define max 5 //symbolic constant | |
int front=-1,rear=-1; // global variable | |
int CQueue[max]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First Come First Served computer scheduling Algorithm implementation in C! | |
#include <stdio.h> | |
#define max 20 /// fixed maximum size for array | |
main() | |
{ | |
int process,burstTime[max],waitingTime[max],averageWaitingTime=0,i,j; | |
printf("Enter The Number of Process(Max 20) : "); | |
scanf("%d",&process); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution is written for the follwing equation | |
* dy/dx=x+2y, where y(x0)=y(0)=0 | |
* we need to use Euler's method to find a value for the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@ Author: Nasir Islam Sujan | |
@ GitHub: https://github.com/78526Nasir | |
*/ | |
/* | |
* This solution was written for | |
* the following equation | |
* f(x) = x^3 - 0.165x^2 + 3.993 * 10^-4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stack implementation in C using Array. | |
#include<stdio.h> | |
#include<stdlib.h> // header file for exit and return function | |
#define max 5 | |
int stack[max],top=-1; // global variable | |
void push(); | |
int pop(); |
NewerOlder