hi...
plz solve this ..
actually binary search takes two tests inside the side the loop .
Now i want with one comparison inside the loop.

Question is: Our binary search makes two tests inside the loop, when one would suffice (at the price of more tests outside.) Write a version with only one test inside the loop and measure the difference in run-time.

Recommended Answers

All 2 Replies

Think about it for awhile, then check out wikipedia.

Our binary search

Does this mean that you have one implementation already? Try posting it so we can see what it is you need to modify.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.