In this project, balanced binary trees are implemented and visualized. It can be used to understand all the concepts of these important data structures, and as repository of methods to use it in other applications.

App functionalities:

  • Create a tree value by value
  • Visualize how each node is inserted
  • Visualize the method to balance the tree
  • Find nodes in the tree and highlight them
  • Delete nodes
  • Visualize all the info of the tree:
    • General structure od parents and children
    • Traversals in Preorder, Postorder, Inorder and Levels
    • Tree height
    • Number of nodes and leaves
    • Balance factors of each node

App parts

Image example

1) This is the button to start, by clicking on it you can start to build the tree.

2) Button to delete a node from the tree

3) Button to search a node in the tree

4) With this other button you can restart with a new tree once you finish with the previous one.

5) Show the info of the tree in the info zone

6) In this area the tree is plotted, with the information and the balance factor of each node, visualization works in real time. if after attaching a node, the tree becomes unbalanced, the tree is balanced before continuing.

7) With these windows you can insert data to the application, the nodes to be added, to search or those that you want to delete.

8) This is the field of information output, here you can see the results, such as the height of the tree, the number of leaves, nodes, balance factors, and when searching or removing a node, if this node is or not in the tree.

Demo

IMAGE ALT TEXT HERE