next up previous
Next: Example Up: CSE 2320: Algorithms and Previous: Queues

Implementation Using an Array

*
Q = queue
*
head(Q) = index to array element containing object in queue
*
tail(Q) = index to array element just beyond element containing object in queue
*
head(Q) = tail(Q) $\longrightarrow$ empty queue
*
head(Q) = tail(Q) + 1 $\longrightarrow$ full queue
(mod length(Q))



Copyright © 1998 The University of Texas at Arlington