News flash: I'm going to Australia in February, so this Web site may be switched off at any time.


Using Icon lists as queues

We have seen how the ``push()'' and ``pop()'' function aid in using Icon lists as stacks. Two more functions allow elements to be added and removed from the end of any list:

To sum up, here is a picture of how the four stack and queue functions in Icon work:

   push -->  +--------+--------+-------+--------+  <-- put
             |  L[1]  |  L[2]  |  ...  |  L[*L] |
   pop  <--  +--------+--------+-------+--------+  --> pull

Next: Generating the elements of an Icon list
See also: Using the Icon programming language
Previous: Using Icon lists as stacks

John W. Shipman, john@nmt.edu