0

i hv 2 write a code for queue fifo rule for patients visiting doctor's clinic.. can any1 atleast tel me the algo? i'll implement it by myself...

3
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by WaltP
0

whenever there is queue, there is fifo rule..

first think what actuatlly happens in a queue, when there is no patient , counter is empty, first position is zero as its last position.

when a patient comes starting position as well as last position becomes 1.
now when 2nd patient comes last position is increased by 1 but starting position is fixed until that 1st guy is in the counter.

when more patients are to come all the time, last position will increase by 1.
when the work of 1st patient is over in the counter what happens he will leave the counter and the second patient will come to the counter i.e, starting position is increased by 1 in order to indicate the 2nd patient.

this is the starting area which you have to do, just think and do like that , if there will be any problem , post your problem with your code, we will surely help you...... :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.