Big O Complexity in Binary Search Tree(BST)
In the absolute worst case, a binary tree with N elements would be like a linked list.Hence, there would be N levels, and a search would take N traversals. That’s why it’s O(N) in the worst case.And this is why we need to balance the trees to achieve O(log N) search.