Asking BST question, the interviewer is probably looking to see how well you can deal with recursive problems.

/************Below function is for Nth max element ******/
void NthMax(Node *root, int n){
if(root == NULL){
return;
}
max(root->right, n);
if(–n == 0){
cout<<"Number is: "<value<left, n);
}

int main()
{
/* for 5th max pass 5 in NthMax(..) ***/
}



Related Contents to follow