| | |
c++ program for round robin
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
•
•
why dont u send the program to me as an attachment to my mail id
a. Rashakil Fol's post
b. it takes in total 3 lines of code
C++ Syntax (Toggle Plain Text)
value = myList.front(); myList.pop_front(); myList.push_back(value);
you should prolly check to see that the list isn't empty first and of corse make the list and varible value , you can then use value, If your doing this in muliple parts of your program.
Its prolly advisable to make a function to do this for you, How far you want to go with this is upto you ( make a template if you will so it can take any type of varible and spit out a value.
If it is infact for an assignment and they havent told you to use any of the standard template libary, they may infact not want you to and if that is the case I would try the following.
1. Create a Linked list
Use an object or a struct ( what ever takes your fancy ) with a varible containing the data and a pointer to another struct of the same type.
Now if your doing a round robin kinda algorithem you may want the lists to be in a nice loop, so insted of having a start and an end you don't.
then make some kinda way of remembing where you are in the list (another pointer to a element) and then change that when you access a value
C++ Syntax (Toggle Plain Text)
imLookingHere = imLookingHere->nextInList;
or what not.
then you just have to worry about attaching things in etc. anyway check out some reasources on the web
STL Lists
STL List
SGI's nice doco
cprogramming's tutorial
Linked Lists
Nice C++ Linked List
Wikipedia artical on Linked Lists
Last edited by Paul.Esson; Sep 17th, 2005 at 6:45 am. Reason: Didn't include enough
•
•
Join Date: Jul 2005
Posts: 60
Reputation:
Solved Threads: 4
Don't mean to be a dick, but I don't like people asking me for all the code I have written for a particular assignment, when they have not shown any effort thus far. Whenever you have to do a programming assignment, start it way ahead of time and work on it a little every day.
http://www.daniweb.com/techtalkforums/thread39018.html
I posted a reply in the above thread that tells you how I did it. I don't know if this will help you or not. I did the assignment in order to keep track of a bunch of things like turnaround time and context switches. My implementation also is formatted so that I could write a gannt chart output function if I so desired.
http://www.daniweb.com/techtalkforums/thread39018.html
I posted a reply in the above thread that tells you how I did it. I don't know if this will help you or not. I did the assignment in order to keep track of a bunch of things like turnaround time and context switches. My implementation also is formatted so that I could write a gannt chart output function if I so desired.
![]() |
Similar Threads
- how to simulate a round robin scheduler (Visual Basic 4 / 5 / 6)
- Round Robin Scheduler (C)
- Round Robin Algorithm Simulation (C++)
- Round Robin Algorithm Simulation (C++)
- regarding round robin algorithm (C++)
Other Threads in the C++ Forum
- Previous Thread: do u have latest C/C++ compiler...pLZ
- Next Thread: something.X
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






