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.

4
  • 2
    Where were you reading that?Normally for binary search, there is no need to create a new array. Commented Jan 23, 2013 at 13:22
  • 1
    there's not only no need, you really shouldn't do it, otherwise your space consumption will go from O(n) to ~O(n^2) (not a tight bound but you'd be heading towards there) Commented Jan 23, 2013 at 13:23
  • you can delete the old array, so you will save space after the copy. Commented Jan 23, 2013 at 13:24
  • Thanks for the comments so far. I was pretty curious about this. But why do I get downvotes exactly? My question is pretty legit. Commented Jan 23, 2013 at 13:25