Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bs_tree.py and the BSTree class #28

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jiyadurai
Copy link

Overview: What does this pull request change?

This pull request adds an implementation of a binary search tree that inherits from NaryTree

Motivation and Explanation: Why and how do your changes improve the library?

This adds simpler operations for constructing binary search trees. Using insert and remove in the BSTree class does not require the user to know the exact positions where they wish to place nodes.

Further Information and Comments

If bs_tree.py is run as a script, then it animates an example with some insertions and a removal. Some notes: if the height gets too large, the animation looks bad. Also, I haven't run into any issues, but the changes are not tested thoroughly.

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added code segments are adequately covered by tests
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section

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.

1 participant