Multiple choice

The above algorithm ____________.

Following is an algorithm to return a key in a BST(Binary Search Tree).
Returnkey(Tree T)
{
x= root[T];
while(right[x] != null)
{
x = right[x];
}
return x;
}

  1. finds the maximum key in the tree

  2. finds the minimum key in the tree

  3. finds the root key in the tree

  4. finds the rightmost leaf-key in the tree

  5. finds the maximum internal node in the tree

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

This is correct, as  the algorithm updates the x value to right[x], it is looking for the maximum key.