e1th4nUwU / Java_Tree_manipulation_program

This Java program allows you to manipulate different types of trees and perform various operations on them. You can use this project to learn how to implement binary trees, binary insertion trees and B-Trees manually. Topics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Java Tree Manipulation Program πŸŒ³πŸ”§

Tree Image This Java program allows you to manipulate different types of trees and perform various operations on them.

Binary Tree Menu 🌳

  1. Exit: Exit the program. ❌
  2. Reset Tree: Clear the binary tree. πŸ”„
  3. Add Data: Add a node to the binary tree. βž•
  4. Delete Node: Delete a node from the binary tree. πŸ—‘οΈ
  5. Print Tree (BFS): Print the binary tree using Breadth-First Search traversal. 🌐
  6. Preorder: Print the binary tree using Preorder traversal. πŸŒ³πŸ”Ό
  7. Inorder: Print the binary tree using Inorder traversal. πŸŒ³βœ…
  8. Postorder: Print the binary tree using Postorder traversal. πŸŒ³πŸ”½
  9. View Nodes with Children: Display the nodes of the binary tree along with their children. πŸ‘₯

Binary Search Tree Menu πŸ”πŸŒ³

  1. Exit: Exit the program. ❌
  2. Reset Tree: Clear the binary search tree. πŸ”„
  3. Add Data: Add a node to the binary search tree. βž•
  4. Delete Node: Delete a node from the binary search tree. πŸ—‘οΈ
  5. Search: Search for specific data in the binary search tree. πŸ”
  6. Print Tree (BFS): Print the binary search tree using Breadth-First Search traversal. 🌐

B-Tree Menu πŸ…±οΈπŸŒ³

  1. Exit: Exit the program. ❌
  2. Reset Tree: Clear the B-Tree. πŸ”„
  3. Add Data: Add data to the B-Tree. βž•
  4. Search Data: Search for specific data in the B-Tree. πŸ”
  5. Print Tree: Print the B-Tree. 🌳🌐

Compiling the Code πŸ› οΈ

To compile the code, follow these steps:

  1. Ensure you have the Java Development Kit (JDK) installed on your system. β˜•

  2. Save the code in a file named Main.java.

  3. Open a terminal or command prompt and navigate to the directory containing Main.java.

  4. Run the following command to compile the code:

    javac Main.java
    
  5. If there are no syntax errors, the code will be compiled, and a Main.class file will be generated.

Running the program▢️

To run the program, use the following command:

java Main

Running the Program from a JAR File πŸ“¦

Alternatively, if you have a JAR file named Arboles.jar, you can run the program using the following command:

java -jar Arboles.jar

That's it! You can now compile and run the Java program to manipulate different types of trees and perform various operations on them. Enjoy! πŸ˜„πŸŒ³

About

This Java program allows you to manipulate different types of trees and perform various operations on them. You can use this project to learn how to implement binary trees, binary insertion trees and B-Trees manually. Topics

License:Creative Commons Zero v1.0 Universal


Languages

Language:Java 100.0%