# Binary Search Trees theory question?

• March 15th, 2014, 06:19 PM
Scorks
Binary Search Trees theory question?
Suppose that a certain BST has keys that are integers between 1 and 10, and we search for 5. Which sequence below cannot be the sequence of keys examined?

(a) 10,9,8,7,6,5
(b) 4,10, 8, 6, 5
(c)1,10,2,9,3,8,4,7,6,5
(d) 2,7,3,8,4,5
(e)1,2,10,4,8,5

I've noticed many differences, such as there is only one with an odd number of keys, and one has all integers from 1-10 inside of it, but I can't find any real reason that you wouldn't be able to search it?
Does anyone know any tips for this?
• March 15th, 2014, 06:35 PM
GregBrannon
Re: Binary Search Trees theory question?
There are specific rules that determine the construct of a binary search tree. Look up those rules and then review the question's possible answers to see if they comply with the rules.
• March 15th, 2014, 06:38 PM
Scorks
Re: Binary Search Trees theory question?
These answers are not in any particular order, so couldn't they ALL be binary search trees, once correctly put into a BST?