Closed aparibocci closed 1 year ago
Hello @StepfenShawn, could I ask you to have a look at this PR, whenever you have a few minutes? Thank you!
I'm drowning in a computer competition in this week. So I'll review and debug your code in next week.
I'm drowning in a computer competition in this week. So I'll review and debug your code in next week.
Amazing! Thank you and best of luck!
As per title, this MR aims to add a Ruby implementation of an AVL tree with distinct key nodes. This is a special case of a binary search tree where self-balancing is implemented upon insertion and deletion, allowing to keep the tree balanced.
Due to self-balancing upon key insertion and deletion, the main operations of this data structure (insertion, deletion, membership) run - in worst case - in
O(log(n))
, wheren
is the number of nodes in the tree.Traversal methods (pre-order, in-order, post-order) with custom consumer as argument are also exposed.