Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 1023 Bytes

README.md

File metadata and controls

25 lines (14 loc) · 1023 Bytes

BinaryTreeTraversal-Java

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.

Features

  • 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.

How to Run

  1. Clone the repository:

    git clone https://github.com/your-username/BinaryTreeTraversal-Java.git
    
  2. Open the project in your preferred Java IDE (like VSCode, IntelliJ IDEA, Eclipse, or NetBeans).

  3. Compile and run the Main.java file.

  4. When prompted, enter a list of numbers separated by spaces to build the tree.

  5. The program will output the in-order, pre-order, and post-order traversals of the tree.