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.
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)
, wheren
is the number of nodes in the tree. The average case for those operations isO(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.