Binary Search Tree (BST) GATE Notes | EduRev

Created by: Pushkar Malik

GATE : Binary Search Tree (BST) GATE Notes | EduRev

The document Binary Search Tree (BST) GATE Notes | EduRev is a part of GATE category.
All you need of GATE at this link: GATE

A Binary Search Tree (BST) stores values in the range 37 to 573. Consider the following sequence of keys.

I. 81, 537, 102, 439, 285, 376, 305
II. 52, 97, 121, 195, 242, 381, 472
III. 142, 248, 520, 386, 345, 270, 307
IV. 550, 149, 507, 395, 463, 402, 270
Q.Suppose the BST has been unsuccessfully searched for key 273. Which all of the above sequences list nodes in the order in which we could have encountered them in the search?
a)II and III only
b)I and III only
c)III and IV only
d)III only
Correct answer is option 'D'. Can you explain this answer?

Ref: https://edurev.in/question/499405/A-Binary-Search-Tree-BST-stores-values-in-the-ra

Key to be searched 273:

  • I) 81, 537, 102, 439, 285, 376, 305 is not correct
    We cannot go to 376 from 285 as 273 is smaller than 285.
  • II) 52, 97, 121, 195, 242, 381, 472 is not correct.
    We cannot go to 472 from 381 as 273 is smaller than 381.
  • III) 142, 248, 520, 386, 345, 270, 307 is correct
    2008_71_sol
  • 550, 149, 507, 395, 463, 402, 270 is not correct.
    We cannot go to 463 from 395 in search of 273

Share with a friend

Related tests

Complete Syllabus of GATE

Content Category

Related Searches

ppt

,

Binary Search Tree (BST) GATE Notes | EduRev

,

study material

,

Previous Year Questions with Solutions

,

Extra Questions

,

Sample Paper

,

Viva Questions

,

Program to Search an Array using Binary Search

,

pdf

,

Exam

,

Binary Search Tree (BST) GATE Notes | EduRev

,

past year papers

,

Objective type Questions

,

Binary Search Trees - PowerPoint Presentation ,Engineering, Semester

,

shortcuts and tricks

,

Binary Search Trees

,

Free

,

practice quizzes

,

Important questions

,

Summary

,

BINARY SEARCH

,

MCQs

,

Binary Search Tree (BST) GATE Notes | EduRev

,

mock tests for examination

,

Program to Search an Array using Binary Search (C Language)

,

video lectures

,

Semester Notes

;