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

delete() & enhancements in BST #56

Merged
merged 11 commits into from
Oct 8, 2019
Merged

delete() & enhancements in BST #56

merged 11 commits into from
Oct 8, 2019

Conversation

ashokdey
Copy link
Member

@ashokdey ashokdey commented Oct 8, 2019

🚁 What's inside?

  • remove(value) which is using delete(root, value) at the core in BST
  • Enhancements:
    • replaced insert(root, value) with add(value)
    • replaced preorder(root) with traversePreorder()
    • replaced postorder(root) with traversePostorder()
    • replaced inorder(root) with traverseInorder()
    • replaced search(root, value) with searchFor(value)

🔧 Fixes and Updates

  • fixed delete case of Node having 2 children, thanks @TheSTL for the feedback.
  • getMinimum() using findMinNode(root)
  • getMaximum() using findMaxNode(root)

🕊

@ashokdey ashokdey requested a review from TheSTL October 8, 2019 18:53
@ashokdey ashokdey self-assigned this Oct 8, 2019
@ashokdey ashokdey added enhancement New feature or request new-data-structure labels Oct 8, 2019
Copy link
Member

@TheSTL TheSTL left a comment

Choose a reason for hiding this comment

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

It doesn't delete the node where found node have left and right child.

Copy link
Member

@TheSTL TheSTL left a comment

Choose a reason for hiding this comment

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

💯

@ashokdey ashokdey merged commit fc1f466 into master Oct 8, 2019
@ashokdey ashokdey deleted the problems branch October 8, 2019 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants