Skip to content

BinarySearchTree Refactor and Documentation Update (C++) #335

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

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

hmigl
Copy link
Contributor

@hmigl hmigl commented Nov 7, 2023

This pull request refactors the existing 'BinaryTree' to 'BinarySearchTree' in the C++ codebase. The key changes are as follows:

  • Renamed 'BinaryTree' to 'BinarySearchTree' to emphasize its Binary Search Tree behavior, enforcing properties that ensure each node is greater than nodes in its left subtree and less than nodes in its right subtree.
  • Updated the README to reflect these changes.
  • Extended the 'BinarySearchTree' to include operations like 'delete', 'find min', and 'find max'. The code is now object-oriented, with 'BinarySearchTree' implemented as a class.

hmigl added 3 commits November 7, 2023 09:30
The 'Node *insert(Node *, int)' method makes the tree a Binary Search Tree, since it enforces these two properties:
- Each node is greater than every node in its left subtree
- Each node is less than every node in its right subtree
...like 'delete', 'find min', 'find max'.

In addition to that, in this version, object oriented code is present.
`BinarySearchTree` is a class, and it has behaviour that operates on the state.
Copy link
Owner

@kelvins kelvins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @hmigl!

@kelvins kelvins merged commit 241c932 into kelvins:main Nov 12, 2023
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