You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Time Complexity for Binary Search Tree (BST) basic operations (Insert, Remove and Search) is not O(log n) if the BST is unbalanced (is O(logn) only when we are talking about Balanced BST such as AVL and Red-Black). The correct time complexity would be O(h) where h is the height of the BST. It is h because the BST may become skewed as the following image.
The text was updated successfully, but these errors were encountered:
The Time Complexity for Binary Search Tree (BST) basic operations (Insert, Remove and Search) is not
O(log n)
if the BST is unbalanced (isO(logn)
only when we are talking about Balanced BST such as AVL and Red-Black). The correct time complexity would beO(h)
whereh
is the height of the BST. It ish
because the BST may become skewed as the following image.The text was updated successfully, but these errors were encountered: