Skip to content

Adding BinarySearchTree implementation#199

Merged
StepfenShawn merged 1 commit intoTheAlgorithms:masterfrom
aparibocci:feature/bst
Feb 23, 2023
Merged

Adding BinarySearchTree implementation#199
StepfenShawn merged 1 commit intoTheAlgorithms:masterfrom
aparibocci:feature/bst

Conversation

@aparibocci
Copy link
Copy Markdown
Contributor

As per title, this MR aims to add a Ruby implementation of a binary search tree with distinct node keys.

The main operations of this data structure (insertion, deletion, membership) run - in worst case - in O(n), where n is the number of nodes in the tree.
The average case for those operations is O(log(n)) due to the structure of the tree, since nodes are inserted following the BST property.

Traversal methods (pre-order, in-order, post-order) with custom consumer as argument are also exposed.

Copy link
Copy Markdown
Member

@StepfenShawn StepfenShawn left a comment

Choose a reason for hiding this comment

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

Thanks!

@StepfenShawn StepfenShawn merged commit 6482401 into TheAlgorithms:master Feb 23, 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