next up previous
Next: Teaching - A Up: Models of Implementations: Previous: Mental Models and

Assumptions and Implications of the Heapsort Example

After discussing the heapsort algorithm for a bit of time, we realized that some of the design decisions made could be uncommitted and recommitted differently and still capture heapsortedness. For example, if we undid the design decision of sorting in place, we could implement the heap with some other implementation of a tree, possibly a linked list.

In some data structures texts, heaps were not discussed primarily to implement heapsort, but rather to implement a priority queue. This relates nicely to Weide's sorting machine example. That is, pieces of the heapsort process, namely the construction and management of the heap, might have use out of the context of sorting, in this case for priority queue implementations. It was actually mentioned that the sorting machine discussed in the previous section could be thought of as a priority queue abstraction.



Larry Latour
Sun Sep 17 21:09:35 EDT 1995