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 / 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 / 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 / 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 / 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 / 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 / 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 / ChildProcess.c
Created December 2, 2016 16:45
Creating Child Process using Fork!
/* This Program is for creating child process. It works only in Linux operating System.
//To run this code in linux environment you need to follow the below steps:
1. write cc and then put the '.c' "file location/address here" then press enter.
2. write ./a.out to generate the output of the code.
*/
#include <stdio.h>
@78526Nasir
78526Nasir / DeleteElementIntoArray.c
Last active June 2, 2016 18:36
Delete an element from an array !
/// Delete an elements from an array ///
#include <stdio.h>
main()
{
int a[5]={1,2,3,4,5},n=5,pos,item,i,j;
printf("Enter an position to delete an element:");
scanf("%d",&pos);
printf("Before deleting element :\n");
for(i=0;i<n;i++)
@78526Nasir
78526Nasir / InsertElementIntoArray.c
Last active June 2, 2016 18:27
These program is for inserting a new elements into an array !
/// insert new elements into an array ///
#include <stdio.h>
main()
{
int a[100],n,pos,item,i;
printf("Enter how many elements :");
scanf("%d",&n);
printf("Enter %d elements values :",n);
for(i=0;i<n;i++)
@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