Question 1
What is the worst case time complexity for search, insert and delete operations in a general Binary Search Tree for a skewed tree ?
Question 2
In delete operation of BST, we need inorder successor (or predecessor) of a node when the node to be deleted has both left and right child as non-empty. Which of the following is true about inorder successor needed in delete operation?
Question 3
We are given a set of n distinct elements and an unlabelled binary tree with n nodes. In how many ways can we populate the tree with the given set so that it becomes a binary search tree? (GATE CS 2011)
Question 6
The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)? (GATE CS 2004)
Question 7
The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?
Question 8
Consider the following Binary Search Tree
If we randomly search one of the keys present in above BST, what would be the expected number of comparisons?
Question 9
Question 10
// 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
There are 41 questions to complete.