Skip to content

Conversation

@Raghu0703
Copy link

This PR adds Binary Search Tree (BST) and AVL Tree implementations to the data structures collection.

Changes:

  • Implemented BST with insert, delete, search operations
  • Implemented AVL Tree with self-balancing rotations (LL, RR, LR, RL)
  • Added comprehensive unit tests for both implementations
  • Included traversal methods (inorder, preorder, postorder)
  • Added proper JavaDoc documentation

These fundamental data structures help demonstrate the difference between basic BST and self-balancing trees, providing educational value for learning algorithm complexity and tree balancing techniques.

Fixes #6957

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

- Implemented BST with insert, delete, search operations
- Implemented AVL Tree with self-balancing rotations
- Added comprehensive unit tests
- Fixes TheAlgorithms#6957
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2025

Codecov Report

❌ Patch coverage is 91.62304% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.62%. Comparing base (f693c44) to head (a1c276c).

Files with missing lines Patch % Lines
...om/thealgorithms/datastructures/trees/AVLTree.java 86.20% 7 Missing and 9 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7099      +/-   ##
============================================
+ Coverage     78.50%   78.62%   +0.11%     
- Complexity     6752     6794      +42     
============================================
  Files           759      760       +1     
  Lines         22402    22478      +76     
  Branches       4400     4404       +4     
============================================
+ Hits          17587    17673      +86     
+ Misses         4109     4101       -8     
+ Partials        706      704       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Raghu0703 Raghu0703 closed this Nov 24, 2025
@Raghu0703 Raghu0703 deleted the add-bst-avl-trees branch November 24, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Add Binary Search Tree (BST) and AVL Tree Implementations in Java

2 participants