← Back to Projects

Binary Search Tree

Implemented a generic binary search tree with full support for insertion, deletion, lookup, and traversal

Data StructuresC++Memory Safety

About This Project

This project involved designing and implementing a binary search tree that maintains strict ordering properties while supporting efficient data operations. The implementation required careful handling of recursion, pointer-based memory management, and edge cases to ensure correctness and robustness across all operations.

Key Features

  • Implemented a generic binary search tree with key-value storage
  • Preserved BST ordering invariants across insertion, lookup, and deletion
  • Handled all deletion cases, including nodes with two children
  • Provided recursive traversal for efficient and sorted data access
  • Ensured memory safety through proper allocation, destruction, and testing

Technologies Used

  • IDE: VSCode
  • C++

Challenges & Learnings

Challenges:

The most challenging part was implementing node deletion correctly, particularly handling nodes with two children while maintaining tree structure. Debugging pointer-related issues and ensuring proper memory cleanup required close attention to detail.

What I Learned:

Through this project, I developed a strong understanding of tree-based data structures, recursion, and dynamic memory management. I learned how to design clean abstractions, manage complex edge cases, and write reliable low-level code—experience that directly translates to systems programming and backend development.

This project was created in March 2025