Thread: Search
View Single Post
Old 10-06-2004, 05:31 PM   #7 (permalink)
keystoneman
Registered User
 
Join Date: Sep 2004
Location: Lancaster, Pa
Posts: 24
keystoneman is on a distinguished road
Send a message via AIM to keystoneman
Hey Val, I have been messing around with yoru code editing it and such, I havent touched you binary part because i'm not sure if its right or wrong, I believe its wrong but then again what do I know ...

Here is a smaple output I generate ...


Code:
Initial array:  40 60 30 70 90 80 5 25 95 100 101

Please enter an integer: 60
Please enter an integer: 80
VALUE   LINEAR  BINARY
60      2       4
80      6       6
Press any key to continue . . .

When I entered the 60 with a bin search should't it produce a 2, and the bin search for 80 shouldnt that produce a 1; I always thought the bin search cut the array in half checking it, and if it wasnt found cutting it again, until it was found?

Am I wrong?
keystoneman is offline   Reply With Quote