Skip to content

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.

8 on this page
Official PYQ2005Programming and Data StructuresBinary Search TreesMCQ · 1 mark
Postorder traversal of a given binary search tree, TT produces the following sequence of keys 10,9,23,22,27,25,15,50,95,60,40,2910, 9, 23, 22, 27, 25, 15, 50, 95, 60, 40, 29 Which one of the following sequences of keys can be the result of an in-order traversal of the tree TT?
Official PYQ2004Programming and Data StructuresBinary Search TreesMCQ · 1 mark
A program takes as input a balanced binary search tree with nn leaf nodes and computes the value of a function g(x)g(x) for each node xx. If the cost of computing g(x)g(x) is: min⁡(number of leaf-nodesin left-subtree of x  ,  number of leaf-nodesin right-subtree of x)\Large \min \left ( \substack{\text{number of leaf-nodes}\\\text{in left-subtree of $x$}}\;,\; \substack{\text{number of leaf-nodes}\\\text{in right-subtree of $x$}}\right ) …
Official PYQ2004Programming and Data StructuresBinary Search TreesMCQ · 1 mark
The following numbers are inserted into an empty binary search tree in the given order: 10,1,3,5,15,12,1610, 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)?
Official PYQ2003Programming and Data StructuresBinary Search TreesMCQ · 1 mark
A data structure is required for storing a set of integers such that each of the following operations can be done in O(log⁡n)O(\log n) time, where nn is the number of elements in the set. Deletion of the smallest element Insertion of an element if it is not already present in the set Which of the following data structures can be used for this purpose?
Official PYQ2003Programming and Data StructuresBinary Search TreesMCQ · 1 mark
Suppose the numbers 7,5,1,8,3,6,0,9,4,27, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree?
Official PYQ2003Programming and Data StructuresBinary Search TreesMCQ · 1 mark
Let T(n)T(n) be the number of different binary search trees on nn distinct elements. Then T(n)=∑k=1nT(k−1)T(x)T(n) = \sum_{k=1}^{n} T(k-1)T(x), where xx is
Official PYQ1997Programming and Data StructuresBinary Search TreesMCQ · 1 mark
A binary search tree contains the value 1,2,3,4,5,6,7,81, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?
Official PYQ1996Programming and Data StructuresBinary Search TreesMCQ · 1 mark
A binary search tree is generated by inserting in order the following integers: 50,15,62,5,20,58,91,3,8,37,60,2450, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24 The number of nodes in the left subtree and right subtree of the root respectively is