Index of /~lucia/courses/ITI1121-15/labs/solutions/t09

Icon  Name                    Last modified      Size  Description
[DIR] Parent Directory - [DIR] 01/ 11-Jan-2015 16:44 - [DIR] 02/ 11-Jan-2015 16:44 -
Quiz:

For the implementation of queue using linked elements, which of the
following two implementations is preferable and why?

Answer:

The preferred implementation for the queue has front pointing at the
first node (on the left), whereas rear is pointing at the last node
(on the right).

With this implementation, bot operations, enqueue and dequeue are
fast. In the sens that neither of them needs to traverse the list of
nodes, and consequently the insertion and removal time is independent
of the number of elements currently stored in the queue.