What is the worst case running time for searching an element in a balanced binary search tree with elements?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Searching for an element in a balanced binary search tree with m nodes has a time complexity of O(log m).
Here, m = n x 2^n. Substituting in O(log m), we have,
O(log (n x 2^n)) = O(log n + log 2^n) = O(log n + n * log 2) = O(log n + n) = O (n)
We use the key property of logarithms: log (a x b) = log a + log b