Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 13 Online
OpenStudy (anonymous):

I have a question about the very fundamentals of bisection methods/binary search. When he says he goes through the code and you know the answer is on the bottom half, so you can throw out the top half, and subsequent searches do the same. Well HOW do they know its in the bottom half? And if they do know its in the bottom half, why cant the search just stop there???

OpenStudy (anonymous):

you have to test to see if the guess it too big, too small, or just right. guess is the half-way point between the upper and lower bounds of the search space. if guess is to big then you know you need to continue searching in the lower half of the search space. if guess is too small then you know that you need to continue searching in the upper half of the search space. the algorithm lends itself well to a recursive procedure.

OpenStudy (anonymous):

http://dpaste.com/1001424/

OpenStudy (anonymous):

thanks! I figured it out. It's GUESS AND CHECK. Derrrrr.... Ha thanks tho.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!