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.
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.