Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    You probably should mention that this approach would be faster on large, sorted arrays than small ones. Commented Sep 27, 2008 at 23:07
  • 9
    why would this be slower on smaller arrays? Commented Aug 22, 2011 at 7:54
  • 3
    @vidstige: He means it scales well, but isn't necessarily fastest for small inputs. Commented Feb 11, 2014 at 12:53
  • This runs in O(lg n) as opposed to O(n), which is way more scalable Commented Sep 22, 2014 at 19:09