Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.24 KB

File metadata and controls

52 lines (37 loc) · 1.24 KB

Binary Search Tree in Java

This project is a simple and clean implementation of a Binary Search Tree (BST) in Java. It includes basic operations such as insertion, deletion, searching, and tree traversals.

📌 Features

  • Insert nodes into the BST
  • Delete nodes from the BST
  • Search for a value
  • Find minimum and maximum values
  • Inorder traversal
  • Preorder traversal
  • Postorder traversal

📁 Project Structure

bst/ ├── Node.java // Node structure for the BST ├── BST.java // BST operations └── MainBST.java // Driver class with example usage

🛠️ How to Run

  1. Clone the repository:
    git clone https://github.com/your-username/BinarySearchTree-Java.git
  2. cd BinarySearchTree-Java
  3. javac bst/*.java
  4. java bst.MainBST

##📌 Sample Output Inorder: 20 30 40 50 60 70 80 Preorder: 50 30 20 40 70 60 80 Postorder: 20 40 30 60 80 70 50 Min: 20 Max: 80 Inorder after delete: 20 30 40 60 70 80

📚 Concepts Used Recursion Binary Search Tree (BST) logic Tree traversal algorithms Object-Oriented Programming (OOP) in Java

✅ Author This project was created by Ata Sakik to practice data structures in Java. Feel free to fork this repo, suggest improvements, or use it for learning purposes!