A binary search tree is used to locate the number 43. Which of the following…

1996

A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are not? Explain.

  1. A.

    61 52 14 17 40 43

  2. B.

    2 3 50 40 60 43

  3. C.

    10 65 31 48 37 43

  4. D.

    81 61 52 14 41 43

  5. E.

    17 77 27 66 18 43

Attempted by 27 students.

Show answer & explanation

Correct answer: A, C, D

Why A is Correct:

Path Check: Starting at 61, we search for 43. Since 43 < 61, we move left. From 52, we again move left, so the upper bound becomes 52. The subsequent numbers 14, 17, and 40 tighten the lower bound sequentially (14 < 17 < 40 < 43). Since 43 lies between 40 and 52, the sequence follows BST ordering rules.

   61       [Target 43 < 61: Go Left]  -> Window: (under 61)
     /
    52       [Target 43 < 52: Go Left]  -> Window: (under 52)
   /
  14         [Target 43 > 14: Go Right] -> Window: (between 14 and 52)
   \
    17       [Target 43 > 17: Go Right] -> Window: (between 17 and 52)
     \
      40     [Target 43 > 40: Go Right] -> Window: (between 40 and 52)
       \
       [43]  Found! (43 is safely between 40 and 52)

Why C is Correct:

Path Check: The sequence establishes a lower bound at 10 and an upper bound at 65. Every subsequent jump narrows the search window down logically: 31 (new lower bound), 48 (new upper bound), and 37 (final lower bound). Since 37 < 43 < 48, the target value fits perfectly inside the valid range.

   10         [Target 43 > 10: Go Right] -> Window: (above 10)
   \
    65       [Target 43 < 65: Go Left]  -> Window: (between 10 and 65)
   /
  31         [Target 43 > 31: Go Right] -> Window: (between 31 and 65)
   \
    48       [Target 43 < 48: Go Left]  -> Window: (between 31 and 48)
   /
  37         [Target 43 > 37: Go Right] -> Window: (between 37 and 48)
   \
   [43]      Found! (43 is safely between 37 and 48)

Why D is Correct:

Path Check: The sequence starts at the high end, continuously establishing and lowering the upper boundary constraints: 81 -> 61 -> 52. From 52, the path jumps left to 14, establishing a lower bound. The path then moves right to 41. Since the final target constraint sits legally within the established active range (41 < 43 < 52), this is a completely possible path.

        81   [Target 43 < 81: Go Left]  -> Window: (under 81)
       /
      61     [Target 43 < 61: Go Left]  -> Window: (under 61)
     /
    52       [Target 43 < 52: Go Left]  -> Window: (under 52)
   /
  14         [Target 43 > 14: Go Right] -> Window: (between 14 and 52)
   \
    41       [Target 43 > 41: Go Right] -> Window: (between 41 and 52)
     \
     [43]    Found! (43 is safely between 41 and 52)

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir