Insert values into a binary search tree that rebalances itself with rotations, so it stays O(log n) tall even for sorted input.
Insert values into a binary search tree that rebalances itself with rotations, so it stays O(log n) tall even for sorted input.
Opens with the full question.