Data Structures | Binary Search Trees | Question 1
What is the worst case time complexity for search, insert and delete operations in a general Binary Search Tree for a skewed tree ?
O(n) for all
O(Logn) for all
O(Logn) for search and insert, and O(n) for delete
O(Logn) for search, and O(n) for insert and delete
In skewed Binary Search Tree (BST), all three operations can take O(n). See the following example BST and operations.
10 / 20 / 30 / 40 Search 40. Delete 40 Insert 50.
Quiz of this Question
Please comment below if you find anything wrong in the above post
My Personal Notes arrow_drop_up
Please Login to comment...