I want to know what will be the time complexity to search, insert and delete an element in a) balanced binary search tree. b) unbalanced binary search tree.
closed as unclear what you're asking by fade2black, Evil, David Richerby, Yuval Filmus, cody Dec 7 '17 at 16:13
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Best case time complexity for search, insertion, and deletion is
O(log n). This would correspond to a balanced tree.
The worst case is
O(n). This would correspond to the unbalanced tree
In addition to user9023727's answer, the time complexity for insert and delete is dependent on the time complexity of the search function. This is because for insert you need to find the correct position to insert, and for delete you need to find the node of the value you are deleting.