Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Binary Search Help Repost.

4: Adsense

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   

10890
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.

#22 szecs   Members   

2940
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   

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.