.figgraphics files, such as can be produced interactively and displayed by the
xfigprogram. But it is designed for diagrams whose contents are to be calculated by a program rather than placed "by hand" as when using
xfig -autorefresh hanoi.figOr just look at the diagram containing the final configuration program, final output
xfig -autorefresh btree.figprogram, output (initial tree), output (heap-ordered tree)
Meanings of node colours are:
You won't want to use this code to heapsort your own data! It's far more complicated, because of the need to capture and display the tree at intermediate stages through the heapsort algorithm. But it does have the interesting feature, easy with SML- or Haskell-style polymorphism, that the code used to repair the heap after extracting the top item (during the second phase) is the same as the code used in heap-ordering the tree (during the first phase).
.tar.gzfile containing all the above.
Jeremy Dawson, jeremy at rsise anu edu au (with dots)