Re: enqueue data structure



dis_is_eagle@xxxxxxxxx writes:

Hi.What is a enqueue?How is it different from a dequeue?How can it be
implemented in C?


head tail
| |
v v
queue: A-B-C-D-E




enqueue(queue,D) ==>

head tail
| |
v v
queue: A-B-C-D-E-D




dequeue(queue) ==>

head tail
| |
v v
queue: B-C-D-E-D

result: A


--
__Pascal Bourguignon__ http://www.informatimago.com/

"You cannot really appreciate Dilbert unless you read it in the
original Klingon"
.