Binary Search Tree Creation and Traversal Visualization from given node points using Drawing Algorithm in Java
This mini-project was developed for the partial fulfilment of the 2nd year, 4th semester of Bachelor of Technology in Data Structures : CSD-223 by following students:-
- Requirements
- Java must be installed
- Gradle to build the project/ Can be build without that too
- Use IntelliJ IDEA to get started quickly
- Try the project without building - Find the latest release in the release section download jar file or the executable.
- For jar run
java -jar Binary-Search-Tree.Traversal.main.jar
in terminal or command prompt. - Provide a text file containing numbers(An example is given in the repo).
- For jar run
- To build this project, clone this repo first.
git clone https://github.com/avinal/Binary-Search-Tree-Traversal
- If you have IntelliJ IDEA installed just open the project and build it the regular way.
- Or you may use gradle to build the project
cd Binary-Search-Tree-Traversal
./gradlew build
- Run the project
cd build/classes/java/main
java Main.class
-
When launched first time the selection menu appears.
- Traversal Options
- InOrder : Root-Right-Left
- PreOrder : Right-Root-Left
- PostOrder : Right-Left-Root
- LevelOrder : Breadth-First-Traversal
- Choose File - Choose the text file.
- Experimental Features
- Compare Mode - Draw three DFS simultaneously
- Show Path - Draw the path of traversal
- Speed Selector - 0.5 second/node to 1.5 second/node
- Traversal Options
-
Choose any options from Traversal pane and Choose a File. Given below is an example for sequence 50 34 67 25 38 65 77 15 33.
-
If we choose Show Path feature. Then the different traversals will show as below.
- Preorder with Show Path
- Inorder with Show Path
- Postorder with Show Path
- Levelorder with Show Path
-
If Compare Mode is activated then the following figure as snapshot occurs.
The compare mode was developed using multithreading.
-
Additionally you can set speed by using the slider.