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
#include<iostream> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
int nodes; //No of nodes in the graph | |
int **A; //A is the adjacency matrix => the graph datastructure | |
public: | |
Graph(int nodes){ | |
this->nodes = nodes; |
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
#include<iostream> | |
#include<queue> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
int nodes; //No of nodes in the graph | |
int **A; //A is the adjacency matrix => the graph datastructure | |
public: | |
Graph(int nodes){ |
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
#include<iostream> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
int nodes; //No of nodes in the graph | |
int **A; //A is the adjacency matrix => the graph datastructure | |
public: | |
Graph(int nodes){ | |
this->nodes = nodes; |
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
#include<iostream> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
int nodes; //No of nodes in the graph | |
int **A; //A is the adjacency matrix => the graph datastructure | |
int **B; | |
public: | |
Graph(int nodes){ |
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
#include<iostream> | |
#include<queue> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
int nodes; //No of nodes in the graph | |
int **A; //A is the adjacency matrix => the graph datastructure | |
public: | |
Graph(int nodes){ |
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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
class FileHandling{ | |
public: | |
void read(string name){ | |
string line; | |
ifstream myfile(name.c_str()); |
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
#include<stdio.h> | |
void display(); | |
void getInput(); | |
void calculateWaitTime(); | |
void turnAroundTime(); | |
int n, a[100],b[100]; | |
int main(){ |
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
#include<stdio.h> | |
void main() | |
{ | |
int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp; | |
float avg_wt,avg_tat; | |
printf("Enter number of process:"); | |
scanf("%d",&n); | |
printf("\nEnter Burst Time:\n"); |
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
#include<stdio.h> | |
void main() | |
{ | |
int bt[20],p[20],wt[20],tat[20],pr[20],i,j,n,total=0,pos,temp,avg_wt,avg_tat; | |
printf("Enter Total Number of Process:"); | |
scanf("%d",&n); | |
printf("\nEnter Burst Time and Priority\n"); | |
for(i=0;i<n;i++) |
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
# include <stdio.h> | |
int main() | |
{ | |
int i,p[20],a[20],b[20],br[20],tat[20],gantt[100][2],n1,n2,n3,c,d,e=0,f=0,g,time=0,t1,t2,t3,t4,t5,t6; | |
float v1=0.0,v2=0.0; | |
FILE *fp; | |
fp=fopen("sjf.txt","r"); | |
while (fscanf(fp,"%d%d%d",&n1,&n2,&n3)!=EOF) | |
{ | |
p[e]=n1; |