BACK

Queues

NEXT

PowerPoint presentations:   Sahni's Lecture 14   Locally maintained slide set       Koffman&Wolfgang, Ch. 6

Applications

DemoPermuteQueue.java  [.txt]  Specimen application of a queue:  generation of all permutations
DemoPermuteQueue.rtf               Above as a word-processor file
DemoPermuteQueue.exe             Directly executable copy

PermuteSort.java  [.txt]    Adding "backtracking" to permutation generation:  sorting based on permutations  [.rtf]
Fast.exe  Slow.exe           Fast.exe uses backtracking; Slow.exe generates full permutations and then checks them.
Perverse                          Tongue-in-cheek article discussing this optimization

Implementations

FifoQueue.java  [.txt]      Sedgewick's minimal interface (as amplified slightly by Rolfe)

LinkedQueue.java  [.txt]  Sedgewick's implementation of a linked-list-based queue, amplified to a queue of objects and adding peek().

ArrayQueue.java  [.txt]    Sedgewick's implementation of an array-based queue, amplified for objects, peek(), rescaling, and display.  [.rtf]
ArrayQueueRun.txt          Output from running the exercising main in ArrayQueue.java

DemoQueue.java  [.txt]   Program to exercise the above code, showing queue states at each put and remove.  [.rtf]
DemoQueue.exe              Directly executable copy thanks to a JSmooth .exe wrapper