Skip to content

AtaSakik/BinarySearchTree-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

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!

About

A simple Java implementation of a Binary Search Tree (BST) with basic operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages