What are the worst case and average case complexities of a binary search tree?
What are the worst case and average case complexities of a binary search tree? Correct Answer O(n), O(logn)
Worst case arises when the tree is skewed(either to the left or right) in which case you have to process all the nodes of the tree giving O(n) complexity, otherwise O(logn) as you process only the left half or the right half of the tree.
মোঃ আরিফুল ইসলাম
Feb 20, 2025