// A BST node
struct node {
int data;
struct node *left, *right;
};
int count = 0;
void print(struct node *root, int k)
{
if (root != NULL && count <= k)
{
print(root->right, k);
count++;
if (count == k)
printf("%d ", root->data);
print(root->left, k);
}
}
15 / \\ 10 20 / \\ / \\ 8 12 16 25
This question is part of this quiz :
Top MCQs on Binary Search Tree (BST) Data Structure with Answers