Binary Search Tree Algorithm Sequence

Harris Calvin

enter image description here

I know this has to do with the searching algorithm but looking at the sequence of numbers I still can't figure anything out.

enter image description here

Any ideas?

Michael Goldshteyn

One way to think about this is that the numbers both lower and higher than the number you are searching for should be getting closer to the number being searched for (from each respective side). What this means is that you should not be trying a number that is more distant than a number already tried (on a respective side).

For example, if you are searching for 500, and you've tried 250, then 750, you cannot try for example 230 or 780, because they are more distant from 500 on their respective sides than the numbers you've already tried (i.e., 250 and 750).

So, without giving away the answer, since this is clearly a homework question, you now have enough information to answer your own question.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related