https://ide.codingblocks.com/s/198859 Hi Can you help me out with this approach ?
Importance of time
https://ide.geeksforgeeks.org/nN7C0CW4sP corrected code.
Store the Calling order in Queue and the ideal order in an Array.
Then compare front element of the queue with the ideal order.
If it matches then increment the time and remove the element.
Else, Dequeue the element and enqueue it again.
The loop will run till the queue is consumed totally.
Why it won’t work if we take the actual processes also in a queue ?
Thank you I got it now