News for hackers. Stuff that matters.
Re:What's wrong with this code, really? by icebraining on Friday September 16, 2011 @10:44AM (#3004606)
> If you're accessing the size of, say, a linked list, you end up sneaking an O(n^2) runtime because it has to re-count the size of the list every iteration to check for termination.

I'd expect any decent linked list implementation to keep an integer with the current size. Java certainly does: http://www.docjar.com/html/api/java/util/LinkedList.java.htm...

There are no comments on this comment yet.