Tuesday, November 5, 2002
Due: Tuesday, November 12, 2002
You may use and modify any sample solutions or other pieces of code that have been posted in this course. Likely useful pieces are the tree-drawing function in ~karl/public_html/2270.fall02/rBinSearchTrees/BinTreeNode.cxx and the subscript operator in ~karl/public_html/2270.fall02/HeapDemo/subscript.cxx.
You may not use any other sources of code.
Use this menu:
i 14 : insert 14 r: remove the top entry 0: reset to empty tree q: exit
Show not only the resulting queue after each insertion or deletion but show the intermediate steps, each triggered by the user hitting the Enter key. (A call to getchar () does the trick).
Use colored nodes to help the user track the changes. You can do this by having
color = CDraw::randomLightColor ();
CDraw::setColor (color);
Make your program work with this makefile: ~karl/public_html/2270.fall02/HeapDemo/Makefile.
© 2002 Karl Winklmann