JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
another tutorial on binary search | Reply
is here.

I found that the Java implementation there is even simpler, conceptually, then the one given in the feature article -- apparently, making the lower and upper bound exclusive instead of inclusive makes it possible to just use (lo + hi) / 2 instead of lo + (hi - lo + 1) / 2.

I found the linked article not long after having failed an SRM problem requiring discrete binary search (on a corner case, naturally), and I don't think I've ever gotten it wrong since.
Subject Author Date
another tutorial on binary search antimatter Jan 17, 2006 at 10:35 PM EST
Re: another tutorial on binary search Kawigi Jan 18, 2006 at 1:19 AM EST
Re: another tutorial on binary search antimatter Jan 18, 2006 at 2:01 AM EST
Re: another tutorial on binary search Kawigi Jan 18, 2006 at 11:45 AM EST
Re: another tutorial on binary search antimatter Jan 18, 2006 at 1:10 PM EST
Re: another tutorial on binary search abstractwhiz Jan 18, 2006 at 1:42 PM EST
Re: another tutorial on binary search antimatter Jan 18, 2006 at 3:27 PM EST
RSS