Expo binary search

What is the worst case running time for searching an element in a balanced binary search tree with n × 2 n n \times 2^{n} elements?

Θ ( n log n ) \Theta(n\log n) Θ ( log ( n ) ) \Theta(\log(n)) Θ ( 2 n log ( n ) ) \Theta(2^{n}\log(n)) Θ ( n ) \Theta(n) Θ ( n 2 n ) \Theta(n\cdot 2^{n})

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.

1 solution

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

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...