Skip to content

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

@RoshanSai07

Description

@RoshanSai07

What would you like to Propose?

I would like to contribute implementations of Binary Search Tree (BST) and AVL Tree under the Trees section of this repository.

These are fundamental data structures in computer science, commonly used in search operations, indexing, and various interview / competitive programming applications. Adding them will improve the completeness of the Trees category within this repository.

Issue details

This feature request proposes to add two important data structures under the Trees category:

(1) Binary Search Tree (BST)

  • Core operations: insert, delete, search
  • Tree traversals: inorder, preorder, postorder
  • Utility: findMin(), findMax()

(2) AVL Tree (Self-Balancing BST)

  • All BST operations + height balancing
  • Implement LL, RR, LR, RL rotations
  • Maintain O(log n) complexity for insert/delete

Both implementations will be provided in Java with clean class structure, modular methods, and clear documentation. JUnit tests will be included to ensure correctness.

This addition will improve the completeness of the repository as these are commonly used in searching, indexing, and interview-related problems.

Additional Information

Before starting development, I'd like confirmation on:

  • Folder structure conventions for trees
  • Preferred approach for handling duplicates in BST/AVL (ignore, allow, counter, etc.)

Happy to take feedback and refine based on maintainers’ suggestions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions