We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
But in the worst case, inserting all the elements in a BST could take O(n^2) time. In the worst case the tree is right skewed, or left skewed. We would require to balance the tree in order to get a O(log n) time.
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
But in the worst case, inserting all the elements in a BST could take O(n^2) time. In the worst case the tree is right skewed, or left skewed. We would require to balance the tree in order to get a O(log n) time.