All Exams Test series for 1 year @ ₹349 only
Question

Suppose that we have numbers between 1 and 1000 in a binary search tree and we want to search for the number 365. Which of the following sequences could not be the sequence of nodes examined ?

This question was previously asked in
UGC NET 2014 Paper 2 Computer Science and Applications Question Paper (28-Dec-2014)
The correct answer is

927, 204,913, 242, 914, 247, 365

In a BST search, at each node we go left if the key is smaller and right if it is larger. Every step therefore narrows an interval (low, high) of allowed values, and every later node must lie inside the current open interval.

4, 254, 403, 400, 332, 346, 399, 365: the interval becomes (4, ∞), (254, ∞), (254, 403), (254, 400), (332, 400), (346, 400), (346, 399); every node fits, so this path is possible.

926, 222, 913, 246, 900, 260, 364, 365: the interval becomes (−∞, 926), (222, 926), (222, 913), (246, 913), (246, 900), (260, 900), (364, 900); every node fits, so this path is possible.

4, 401, 389, 221, 268, 384, 383, 280, 365: the interval becomes (4, ∞), (4, 401), (4, 389), (221, 389), (268, 389), (268, 384), (268, 383), (280, 383); every node fits, so this path is possible.

927, 204,913, 242, 914, 247, 365: at 913 we move left because 365 \(\lt\) 913, so every later node must be smaller than 913. After 242 the interval is (242, 913), yet the next node is 914 \(\gt\) 913. This violates the BST property, so this sequence cannot occur.

Hence, the answer is 927, 204,913, 242, 914, 247, 365.

Was this answer helpful?

Similar Questions

  1. Suppose that we have numbers between 1 and 1,000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined ?

  2. In a ____the left and right subtrees for any given node, differ in height by more than one.

  3. Which of the following description(s) is/are true:

    A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.

    B. Trie - Used for efficient prefix - based searches.

    C. AVL Tree - self balancing binary search tree with looser balance criteria than a Red Black Tree.

    D. B- Tree -  Allows efficient search, inert, delete operations in disk based system.

    Choose the correct answer from the options given below:

  4. __________ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice as long as the path from the root to nearest leaf.


Important Questions from Binary Search Tree - Teaching

  1. 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?

  2. Suppose that we have numbers between 1 and 1,000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined ?

  3. In a ____the left and right subtrees for any given node, differ in height by more than one.

  4. Which of the following description(s) is/are true:

    A. Red Black Tree - Guarantees worst case of O(log n) time for search, insert & delete.

    B. Trie - Used for efficient prefix - based searches.

    C. AVL Tree - self balancing binary search tree with looser balance criteria than a Red Black Tree.

    D. B- Tree -  Allows efficient search, inert, delete operations in disk based system.

    Choose the correct answer from the options given below:

  5. __________ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice as long as the path from the root to nearest leaf.

Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
300 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App