Skip to content

Instantly share code, notes, and snippets.

View 78526Nasir's full-sized avatar
🎯
Focusing

Nasir Islam Sujan 78526Nasir

🎯
Focusing
View GitHub Profile
@78526Nasir
78526Nasir / Queue.c
Created January 27, 2016 15:09
Queue Implementation In C Using Array !
//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];
@78526Nasir
78526Nasir / ceilAndFloor.c
Created April 28, 2016 05:57
Ceiling and Floor a number without using library function's !
/* 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
@78526Nasir
78526Nasir / Secant.java
Created December 20, 2017 16:57
Secant method implementation in java.
/*
@ 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.
@78526Nasir
78526Nasir / FalsePosition.cpp
Created December 20, 2017 16:59
False Position method implementation in c.
/**
@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
@78526Nasir
78526Nasir / Round Robin.c
Last active September 26, 2021 17:42
Round Robin CPU scheduling algorithm implementation in C!
// 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
@78526Nasir
78526Nasir / Circular_Queue.c
Created January 28, 2016 04:22
Circular Queue Implementation in C using array !
//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];
@78526Nasir
78526Nasir / FirstComeFirstServed.c
Last active June 14, 2020 10:46
First Come First Served computer Scheduling Algorithm Implementation in C!
// 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);
@78526Nasir
78526Nasir / Euler's.java
Last active December 20, 2017 16:54
Euler's method implementation in java.
/*
@ 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
@78526Nasir
78526Nasir / NewtonRaphson.java
Created December 20, 2017 16:53
Newton raphson method implementation in java.
/*
@ 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
@78526Nasir
78526Nasir / Stack.c
Last active July 18, 2017 03:00
Stack Implementation In C using Array !
// 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();