Skip to content

JakesShell/BST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

BST

This repository features a Java implementation of a Binary Search Tree (BST), designed to demonstrate fundamental data structure operations. The BinarySearchTree class provides methods for inserting, deleting, and traversing nodes in various orders.

Key Features:

-Node Structure: Each node in the tree contains a value and references to left and right children, encapsulated in the Node class.

-Insertion: Nodes can be added to the tree while maintaining the BST properties, ensuring that left children are smaller and right children are larger.

-Deletion: The app supports node removal, handling cases with zero, one, or two children.

-Traversal Methods: Users can traverse the tree in three different orders:

-In-Order: Outputs values in ascending order.

-Pre-Order: Outputs the root node before its children.

-Post-Order: Outputs the root node after its children.

How It Works:

-Insert Nodes: Users can insert integer values into the tree, which organizes them according to BST rules.

-Delete Nodes: Users can remove nodes by their value, with the tree automatically rebalancing as needed.

-Traversal Options: Users can choose how to traverse the tree, with results printed to the console.

This project serves as a practical exercise in understanding tree data structures and their operations, making it an excellent resource for students and developers looking to solidify their knowledge of algorithms and data management in Java.

About

This repository features a Java implementation of a Binary Search Tree (BST), designed to demonstrate fundamental data structure operations. The BinarySearchTree class provides methods for inserting, deleting, and traversing nodes in various orders.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages