Date: Tue, 1 Nov 88 20:45:45 EST To: NeWS-makers@brillig.umd.edu Subject: Graphic display of binary search tree manipulation in NeWS From: gondor.cs.psu.edu!callahan@psuvax1.psu.edu (Paul B. Callahan) The follow shar file contains the code for NeWS window program that allows the user to "edit" binary search trees. It is contained in the files treeedit.c, and treeedit.cps. The executable csh file cctreeedit will compile it into treeedit if your system is configured in the same way as the one I used. The editor is easy to use. The default initial tree is just a single node. The left mouse button causes a tree rotation on the edge going into a node, if it is clicked directly on the node. If it is clicked far away, it allows gradual movement of the current node. The middle mouse button is used to select the node it is clicked on as the current node. The right button causes insertion of a node in a place determined by the x coordinate of the mouse location. Finally, the screen button DELETE deletes the current node. When the window is zapped, the c program outputs an RPN expression for the tree to stdout. This sort of expression can also be input as the current tree using the -i option. Have fun, and reply with any feedback or suggestions.