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
Postorder traversal of a given binary search tree, produces the following sequence of keys Which one of the following sequences of keys can be the result of an in-order traversal of the tree ?
A program takes as input a balanced binary search tree with leaf nodes and computes the value of a function for each node . If the cost of computing is: …
The following numbers are inserted into an empty binary search tree in the given order: . What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?
A data structure is required for storing a set of integers such that each of the following operations can be done in time, where 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?
Suppose the numbers 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?
Let be the number of different binary search trees on distinct elements. Then , where is
A binary search tree contains the value . The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output?
A binary search tree is generated by inserting in order the following integers: The number of nodes in the left subtree and right subtree of the root respectively is
