Skip to content

Conversation

@amarmaurya-com
Copy link

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


📄 Description

This pull request introduces implementations of Binary Search Tree (BST) and AVL Tree data structures in Java.

Both implementations follow object-oriented design principles and include essential operations such as insertion, deletion, traversal, and height balancing (for AVL).
All methods follow Java naming conventions and are formatted according to the repository's style guidelines.


Implemented Features

Binary Search Tree (BST)

  • Insertion of nodes
  • Deletion of nodes
  • Search operation
  • Inorder, Preorder, and Postorder traversals
  • Height calculation
  • Utility methods for minimum and maximum value retrieval

AVL Tree

  • Node rotation (Left, Right, Left-Right, Right-Left)
  • Height balancing after insertion and deletion
  • Automatic height updates
  • Balance factor calculation
  • Traversal support (Inorder, Preorder, Postorder)
  • Exception handling for invalid operations

@codecov-commenter
Copy link

codecov-commenter commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 0% with 284 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.35%. Comparing base (bb6385e) to head (d0024b7).

Files with missing lines Patch % Lines
src/main/java/com/thealgorithms/tree/AVL.java 0.00% 155 Missing ⚠️
src/main/java/com/thealgorithms/tree/BST.java 0.00% 129 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6994      +/-   ##
============================================
- Coverage     78.35%   77.35%   -1.00%     
  Complexity     6615     6615              
============================================
  Files           746      748       +2     
  Lines         22015    22299     +284     
  Branches       4320     4348      +28     
============================================
  Hits          17249    17249              
- Misses         4078     4362     +284     
  Partials        688      688              

☔ 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.

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.

2 participants