I have a question about roundrobin algorithm with queue and I am new with data structures. The algorithm should make this:
- we get 3 numbers like
(12 5 8)and one quantum number for exampleq:10 Then algorithm should make this :
step1: 12 5 18 step2: 5 18 2 step3: 18 2 step4: 2 8 step5: 8 step6: array is empty
As you see when quantum number is equal or bigger than array's number, we will delete first number in array. when quantum number is smaller than our number ,then quantum-number (12-10=2) will be added to the end of the array.
Can someone help me ?