This repository contains a simple Java implementation of a binary tree with three types of traversal methods: in-order, pre-order, and post-order. The program allows users to input numbers to construct the binary tree and then displays the results of each traversal.
- Binary Tree Structure: Supports inserting nodes and creating a binary search tree.
- Traversal Methods: Includes in-order, pre-order, and post-order traversal methods.
- User Input: Users can input a list of numbers, which will be added to the binary tree.
-
Clone the repository:
git clone /~https://github.com/your-username/BinaryTreeTraversal-Java.git
-
Open the project in your preferred Java IDE (like VSCode, IntelliJ IDEA, Eclipse, or NetBeans).
-
Compile and run the Main.java file.
-
When prompted, enter a list of numbers separated by spaces to build the tree.
-
The program will output the in-order, pre-order, and post-order traversals of the tree.