News for hackers. Stuff that matters.
Re:Why you should never, EVER use linked-lists in your code by mrmaddog on Thursday March 08, 2012 @04:41AM (#3679166)
Until then, why do not we all just stay away from the linked-list for the time being? After all C++ is all about performance - and linked-list is not!

No, thank you. Instead, why don't we try and understand the benefits and pitfalls of various data structures? Although linked lists may not be a great generic data structure, they can be incredibly useful for certain types of actions. Enumerating their strengths is a much more useful exercise than asserting sweeping generalizations.

As for your example: any stack or queue data structure is more efficiently implemented with a linked list than an array/vector. (Or any data structure that just needs to do operations on the head/tail of a data structure.)

Re:Why you should never, EVER use linked-lists in your code by Adrock on Thursday March 08, 2012 @06:13AM (#3679347)
In Java, I've never seen a linked list implementation outperform the stock implementation of an array-backed deque for stacks or queues.

http://docs.oracle.com/javase/6/docs/api/java/util/ArrayDequ...

I highly recommend that every Java developer read the source for this class (and the rest of the java.util Collections).

Re:Why you should never, EVER use linked-lists in your code by yread on Thursday March 08, 2012 @07:04AM (#3679433)
or operation like "move elements in the range 1000..5000 to the beginning"