Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Binary Search Help Repost.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
22 replies to this topic

#21 rip-off   Moderators   -  Reputation: 8689

Like
0Likes
Like

Posted 29 June 2012 - 05:32 AM

Your for loop doesn't make any sense in the context of the algorithm. You're not iterating over the array - you're leapfrogging over portions of it. The key observation is that the value of "i" is irrelevant in the loop body. Unless you just want to do something N times, this is a sign that something is amiss.

Sponsor:

#22 szecs   Members   -  Reputation: 2185

Like
0Likes
Like

Posted 29 June 2012 - 05:48 AM

Facepalm.
Binary search works only with sorted lists.....
Sorry. I didn't really take a look at the algorithm.

#23 drgham   Members   -  Reputation: 105

Like
1Likes
Like

Posted 29 June 2012 - 10:23 AM

thanks i benefited
Posted Image




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS