Open in app

Sign In

Write

Sign In

Praseeda Saripalle
Praseeda Saripalle

17 Followers

Home

About

Dec 14, 2022

Operating Systems — Some Important Lab Programs [Part 2]

Round Robin Problem #include<stdio.h> #include<conio.h> int main() { int p[30],p1[30],g[30],t,bt[30],wt[30],ta[30],sum=0,i,j,n,sw=0,sb=0,k=0; float temp=0,max=0; g[0]=0; printf("enter the number of processes="); scanf("%d",&n); for(i=0;i<n;i++) { printf("\nenter the burst time of process p%d=",i+1); scanf("%d",&bt[i]); p[i]=bt[i]; } printf("Enter the size of time slice--"); scanf("%d",&t); max=bt[0]; for(i=1;i<n;i++) { if(max<bt[i]) { max=bt[i]; } } for(j=0;j<(max/t);j++) { for(i=0;i<n;i++) { if(bt[i]!=0) { if(bt[i]<=t) { ta[i]=temp+bt[i]; temp=temp+bt[i]; g[k+1]=g[k]+bt[i]; bt[i]=0; } else { bt[i]=bt[i]-t; temp=temp+t; g[k+1]=g[k]+t; } p1[k]=i+1; k++; } } } for(i=0;i<n;i++) { wt[i]=ta[i]-p[i]; sum+=ta[i]; sw+=wt[i]; sb+=p[i]; } printf("\nROUND ROBIN SCHEDULING ALGORITHM\n"); printf("--------------------------------"); printf("\n Process\tBurst time(ms)\t\t Waiting Time(ms)\t TurnAround Time(ms)\n\n"); for(i=0;i<n;i++) { printf(" P%d\t\t\t%d\t\t\t%d\t\t\t%d\n",i+1,p[i],wt[i],ta[i]); } printf("\n\nGantt Chart:\n\n"); for(i=0;i<k;i++) { printf(" P%d",p1[i]); } printf("\n 0"); for(i=1;i<=k;i++) { printf(" %d",g[i]); } printf("\n\nAverage Waiting…

Operating Systems

3 min read

Operating Systems

3 min read


Nov 23, 2022

Operating Systems — Some Important Lab Programs [ Part 1]

Practice some of the important Lab Concepts from Operating Systems 1. Deadlock Avoidance: #include<stdio.h> #include<conio.h> #include<windows.h> void main() { int k=0,output[10],d=0,t=0,ins[5],i,avail[5],allocated[10][5],need[10][5],MAX[10][ 5],pno,P[10],j,rz, count=0; system("CLS"); printf("\n Enter the number of resources : "); scanf("%d", &rz); printf("\n enter the max instances of each resources\n"); for(i=0;i<rz;i++) { avail[i]=0; printf("%c= ",(i+65)); scanf("%d",&ins[i]); } printf("\n Enter the number of processes : "); scanf("%d", &pno); printf("\n Enter the allocation matrix \n "); for(i=0;i<rz;i++) printf(" %c",(i+65)); printf("\n"); for(i=0;i<pno;i++) { P[i]=i; printf("P[%d] ",P[i]); for(j=0;j<rz;j++) { scanf("%d",&allocated[i][j]); avail[j]+=allocated[i][j]; } } printf("\nEnter the MAX matrix \n "); for(i=0;i<rz;i++) { printf("…

Operating Systems

4 min read

Operating Systems

4 min read


Nov 23, 2022

Compiler Design — Some Important Lab Programs

Practice some of the commonly used Programs from Compiler Design 1. To write a C Program to Compute the first and follow sets of given grammar. Description: FIRST and FOLLOW are two functions associated with grammar that help us fill in the entries of an M-table. FIRST ()− It is a function that gives the set of terminals that begin the strings derived from the production…

6 min read

Compiler Design — Some Important Lab Programs
Compiler Design — Some Important Lab Programs

6 min read


Nov 9, 2021

Visualize to Realize your Data

A need for Quality Data Visualization is as high as ever! — By now, if you have experienced the perks of being a typical Data Analyst and Machine Learning Enthusiast, you would just love exploring with the data and the storyline behind everything you code! Being a Data Scientist, you are not only a Computer Engineer or Programmer, you are just an…

3 min read

Visualize to Realize your Data
Visualize to Realize your Data

3 min read


Jul 3, 2021

All you need to know about the basics of ARIMA

Time series refers to a series of data points indexed to a specific order of time. Time series analysis refers to the usage of some statistical measures to analyze time-series data and extract some key inferences from it. Time series forecasting is the creation of a predictive model that helps…

Arima

4 min read

All you need to know about the basics of ARIMA
All you need to know about the basics of ARIMA
Arima

4 min read


May 8, 2021

Build your AI System like a Pro

(Part-2 of AI Ethics Series) As the field of AI unfolds, it is also important to gradually evolve even with AI Ethics. It is always believed that when you find something extremely pro, it is obvious for the con to accompany it! The art is, how do you actually handle…

3 min read

3 min read


May 5, 2021

AI- A Treat or a Threat?

(Part-1 of AI-Ethics Series) In this world of emerging technologies, technology has almost taken charge of this entire world. For the immense data that is being generated, and the way that this world is so complexly designed, sometimes it feels that there should some creation that mimics the human brain…

3 min read

3 min read


Apr 29, 2021

Pre-Prediction Process on Placements using Python.

The life of a student is not just a journey, it's an emotion! We greatly have the tendency to define “success” based on our limited perspectives. Generally, that perspective is influenced by others' thoughts and opinions.. its nothing but trying to go by what the majority does! Being at the…

Student Recruitment

6 min read

Pre-Prediction Process on Placements using Python.
Pre-Prediction Process on Placements using Python.
Student Recruitment

6 min read

Praseeda Saripalle

Praseeda Saripalle

17 Followers

Data Science Aspirant

Following
  • Srujana Karri

    Srujana Karri

  • Terence Shin

    Terence Shin

  • Usha Ramani Vemuru

    Usha Ramani Vemuru

  • The Word Wave

    The Word Wave

  • Krishnasindhu

    Krishnasindhu

See all (6)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech