Q: Given an array of thousand numbers how many comparison is required to find a number x ?
A: Divide array into two everytime and find which side X will fall, repeat this untill found. Could take around 8-10 comparision.
This is also open for better solution...
A: Divide array into two everytime and find which side X will fall, repeat this untill found. Could take around 8-10 comparision.
This is also open for better solution...
No comments:
Post a Comment