Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6892191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:30:13+00:00 2026-05-27T06:30:13+00:00

I have to make a Round Robin scheduler for a class. I initially created

  • 0

I have to make a Round Robin scheduler for a class. I initially created 3 List<int> lists to represent the process ids, their arrival time and their processing time. I sorted them by their arrival times. The processes are being assigned a fixed quantum (I’ve hard-coded that as 4) and now I want to apply RR on them and display the sequence order of each process & their remaining time in a textBox on a form.

I found one approach here, but it’s in java:
https://stackoverflow.com/questions/7544452/round-robin-cpu-scheduling-java-threads

I tried converting my three lists into object lists as shown in the link but basically, so far I’ve succeeded in creating a list of objects that represent processes. In each object, the processname, arrivaltime, bursttime are stored. This is represented by a class called PCB.

Now I’ve created a list in which to add a number of processes:

public List<pcb> list = new List<pcb>(); // In place of ArrayList used in the 
                                         // example code in the link.

//For loop runs in which above 3 parameters are assigned values & then they're 
// added to list:

PCB pcb = new PCB(processname1, arrivaltime1, bursttime1);
list.Add(pcb);

But how do I search through each value of the list in order to find an item and manipulate it? Say I want to access bursttime of processname="P1" and decrement it by 4?

Is this the wrong data structure for it in C#?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:30:14+00:00Added an answer on May 27, 2026 at 6:30 am
    // To access the value:
    int bursttime1 = list.FirstOrDefault(x => x.processname == "P1").bursttime;
    // To change it:
    list.FirstOrDefault(x => x.processname == "P1").bursttime -= 4;
    

    If you prefer iterating through the list:

    foreach (PCB pcb in list) {
        if (pcb.processname == "P1") {
            pcb.bursttime -= 4;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to make a rudimentary FSM in a class, and am writing it
I have a round button, but i will make it have a backgroud with
I have following code like this in 'artists_helpers' class. def round_to(x) (self * 10**x).round.to_f
i am using jquery.imgr.js to make image corner round in php file. i have
I have to make column charts in Excel using VBA only (no user input).
I have to make a schema for an XML format that's already being used.
I have to make a graphical user interface application using the language of my
I have to make a connection to an XMLRPC site from a web application,
I have to make a JSP/HTML pages. How to fix height and width on
I have to make a decision of which database server to use for my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.