GATE CS Binary Search Trees questions
Practise Binary Search Trees questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
Which of the following statement(s) is/are TRUE for any binary search tree (BST) having distinct integers?
Suppose the values are inserted in that order into an initially empty binary search tree. Let be the resulting binary search tree. The number of edges in the path from the node containing to the root node of is _________. (Answer in integer)
You are given a set of distinct integers. A binary search tree is created by inserting all elements of one by one, starting with an empty tree. The tree follows the convention that, at each node, all values stored in the left subtree of the node are smaller than the value stored at the node. You are not aware of the sequence in …
Suppose a binary search tree with distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with the largest element of the tree is stored at index ______________ .
A binary search tree contains distinct elements. What is the time complexity of picking an element in that is smaller than the maximum element in ?
The preorder traversal of a binary search tree is . Which one of the following is the postorder traversal of the tree?
In a balanced binary search tree with elements, what is the worst case time complexity of reporting all elements in range ? Assume that the number of reported elements is .
Let be a binary search tree with nodes. The minimum and maximum possible heights of are: Note: The height of a tree with a single node is .
The pre-order traversal of a binary search tree is given by . Then the post-order traversal of this tree is
The number of ways in which the numbers can be inserted in an empty binary search tree, such that the resulting tree has height , is _________. Note: The height of a tree with a single node is .
What are the worst-case complexities of insertion and deletion of a key in a binary search tree?
Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)?
While inserting the elements in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is
Suppose we have a balanced binary search tree holding numbers. We are given two numbers and and wish to sum up all the numbers in that lie between and . Suppose there are such numbers in . If the tightest upper bound on the time to compute the sum is , the value of …
The preorder traversal sequence of a binary search tree is . Which one of the following is the postorder traversal sequence of the same tree?
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of nodes?
The worst case running time to search for an element in a balanced binary search tree with elements is
What is the maximum height of any AVL-tree with nodes? Assume that the height of a tree with a single node is .
You are given the postorder traversal, , of a binary search tree on the elements . You have to determine the unique binary search tree that has as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this?
How many distinct binary search trees can be created out of distinct keys?
