Posts

Showing posts with the label latest

Round Robin Scheduling algorithm in C

Round Robin Algorithm in C TheLazyBusyCoder's Blog Welcome to my coding adventures! In this post, we'll explore a C program. Round Robin - scheduling algorithm in C Check out my YouTube video: Watch now #include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct process { int id , at , bt , ct , tat, wt , rt; } process; typedef struct queue { int pro; } queue; queue root[50]; int front = 0; int rare = 0; void push(int id) { root[rare].pro = id; rare++; } int pop() { if(front == rare) return -1; int temp = root[front].pro; front++; return temp; } int isEmpty() { if(front == rare) return 1; return 0; } void sortAT(process pro[], int n) { process temp; for(int i = 0; i pro[j + 1].at) { temp = pro[j]; pro[j] = pro[j + 1]; pro[j + 1] = temp; } } void display(process ...