Bing-O !

In worst case, searching in a Binary Tree is done in _______ \text{\_\_\_\_\_\_\_} .

O ( n ) O(n) O ( n log n ) O(n \log n) O ( 1 ) O(1) O ( log n ) O(\log 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.

2 solutions

Zeeshan Ali
Feb 6, 2016

The Binary Trees, in worst case, might be left-heavy or right heavy or even a tree having nodes with only left children or only right children cause the searching be done in O(n).

The trees given in figure are just like a linked-list for which the searching is done in O(n) :)

Vijay Kumar
Feb 7, 2016

At worst case, the binary tree formed will be skew tree... and hence searching here takes O(n) in the worst case.

Yeah! You have got it right! :)

Zeeshan Ali - 5 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...