How queues are working..
Object a, b, c, d;
Queue q;q.enter(a); //Object a enters the queue. q->a
q.enter(b); //Object b enters the queue. q->a->b
q.enter(c); //Object c enters the queue. q->a->b->c
Object x = q.exit(); //a exits the queue into x. q->b->c
q.enter(d); //Object d enters the queue q->b->c->d
Object y = q.exit(); //b exits the queue into y. q->c->d
No comments:
Post a Comment