What would come in place of y and z respectively in the above algorithm?
An iterative algorithm to search for key k in a tree T is given below-
search(T,k)
{
x = root(T);
while(x!=null or x!= k)
{
if(x < k) x= right[x];
else y
}
return z;
}
Reveal answer
Fill a bubble to check yourself