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.

2
  • 1
    I don't think remove is O(1)... When you call remove, it removes from the list and messes up the indexes. Commented Jan 19, 2010 at 23:49
  • Just because you remove an object from a sorted list doesn't mean it's still not sorted... ie. [3, 5, 6]. There's not a 4 in the list, but it's still sorted properly... So the sort would only have to occur after the put. Commented Apr 12, 2012 at 6:00