BST and Self Balancing BST

Space/Time complexity:

BST
Space : O(n)
Time:
Insert: Best - O(log n) and Worst - O(n)
Delete: Best - O(log n) and Worst - O(n)
Search: Best - O(log n) and Worst - O(n)

Self balancing BST
Space : O(n)
Time:
Insert: Best - O(log n) and Worst - O(log n)
Delete: Best - O(log n) and Worst - O(log n)
Search: Best - O(log n) and Worst - O(log n)

As Red Black tree balance its height, that's why manage Insert/Delete/Search operation in O(log n) in the worst case as well.
Topic archived. No new replies allowed.