(Choose 1 answer)
Given a search() method in a binary search tree:
Node search(int x)
{ Node p = root;
while(p!=null && p.info != x)
{if(x<p.info) p = p.left;else p=p.right;
} return(p);
}
The complexity of this algorithm is:
A. O(n^2)
B. O(n).
C. O(log n).
D. O(nlog n)
Exit 49