previous | index | next

Operations for the Queue ADT

     (make-queue)
       ;; returns a newly created empty queue.

     (empty-queue? queue)
       ;; returns #t if queue is empty, otherwise #f.

     (head queue)
       ;; returns the element which is at the head of queue,
       ;; that is, the element that has been waiting the longest,
       ;; provided queue is nonempty.

     (dequeue! queue)
       ;; removes the head of queue, provided queue is
       ;; nonempty. The return value is the modified queue.

     (enqueue! queue item)
       ;; inserts item at the tail of queue, that is, as the most
       ;; recent arrival. The return value is the modified queue.

previous | index | next