Skip to content

Java Binary Search Tree with CRUD operations and tree traversal algorithms - educational data structures project

Notifications You must be signed in to change notification settings

DavidShableski/trees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Trees Project

Objective

The Trees Project focuses on implementing a generic Binary Search Tree (BST) in Java. This project showcases various operations such as insertion, deletion, search, and traversal on a binary search tree. The primary goal is to deepen understanding of data structures and algorithms, specifically trees and their applications.

Skills Learned

  • Proficiency in implementing data structures and algorithms in Java.
  • Understanding of binary tree and binary search tree concepts.
  • Ability to perform operations such as insertion, deletion, and search in a BST.
  • Enhanced knowledge of tree traversal techniques (in-order, pre-order, post-order).
  • Development of problem-solving and critical thinking skills through algorithmic challenges.

Tools Used

  • Java for programming the binary search tree and its operations.
  • NetBeans and Visual Studio Code as development environments.

Steps

Step 1: Insert Nodes

Insert nodes into the binary search tree and print the tree structure.

Step 2: Check Node Presence

Check whether certain nodes are present in the tree using the contains method.

Step 3: Find Nodes

Find specific nodes in the tree and handle cases where nodes are not found.

Step 4: Remove Nodes

Remove nodes from the tree and observe the changes in the tree structure.

Step 5: Tree Traversal

Perform and print in-order, pre-order, and post-order traversals of the tree.

How to Run

  1. Clone the repository.
  2. Open the project in NetBeans or Visual Studio Code.
  3. Compile and run the Main class to see the binary search tree operations in action.

Conclusion

This project demonstrates the fundamental operations of a binary search tree and highlights the importance of data structures and algorithms in computer science. By working through this project, you will gain practical experience in Java programming and deepen your understanding of tree-based data structures.