This program allows the animation
of three types of binary search trees:
- Basic binary search trees
- AVL trees
- Threaded binary search trees
The program shows in the screen several components:
- a menu
- a yellow bar showing the chosen options by the user
- a blue panel for drawing trees
- a text area showing this help and other technical information
- a button bar
- an area for input text
The menu consists of five sub menus allowing to choose the type of binary
search tree, the mode, the desired animation, some options and the help to display in the left panel.
The button bar holds the buttons for the operations and changes according to the type and the mode chosen.
The mode "Principle" consists in inserting and deleting items in the trees.
The mode "Traversal" consists in traversing the trees by different ways.
The mode "Navigation" consists in navigating in the tree from one node to
another one in all directions.
If the chosen mode is "Principe" the mechanism of insert and delete operations can be shown throw animations.
For the mode "Principle", the operations are : Init, Random tree, Insert, Insert n, Delete,
Delete all. In the case of the basic binary search tree, there exist an additional operation (Balance) which the role is to balance the tree.
For the mode "Traversal", the operations are : Random tree, Preorder, Inorder, Postorder, BFS(Breadth First Search), Inverse preorder, Inverse Inorder, Inverse Postorder, Inverse BFS.
For the mode "Navigation", the operations are : Random tree, Next preorder, Next inorder, Next Postorder, Previous preorder, Previous inorder and Previous
postorder.
|
|
The different operations are described in what follows :
Principle:
Init : erase the tree figuring in the drawing panel
Random tree : draw a BST, an AVL tree of a threaded BST with n nodes. n is given in the input
text.
Insert n : insert successively n random values. n is given in the input
text.
Insert : insert the key given in the input text
Delete : delete the key given in the input text
Delete all : delete successively all keys of the tree
Balance : balance the tree present in the drawing panel
Traversal:
Pre : traverse the tree in preorder traversal
In : traverse the tree in inorder traversal
Post : traverse the tree in postorder traversal
BFS : traverse the tree in Breadth First Search traversal
Inv. Pre : traverse the tree in inverse preorder traversal
Inv. In : traverse the tree in inverse inorder traversal
Inv. Post : traverse the tree in inverse postorder traversal
Inv. BFS : traverse the tree in inverse Breadth First Search traversal
Navigation:
Next Pr : the next preorder of a given node
Next In : the next inorder of a given node
Next Post : the next postorder of a given node
Previous Pr : the previous preorder of a given node
Previous In : the previous inorder of a given node
Previous Post : the previous postorder of a given node
|