3 ms·
I feel like this could have perhaps mentioned the cases where one should use linked lists. Is a simple queue still implemented as a linked list? That is all I
by gamegoblin 13y ago
I feel like this could have perhaps mentioned the cases where one should use linked lists.
Is a simple queue still implemented as a linked list? That is all I ever seem to use them for.
- theboss 13y agoA queue would be an excellent time to use a linked list. I don't understand the point of making a claim like this about a data-structure. The most fundamental thing in data-structures is that there is a time and a place for using each one. No data-structure is inherently 'better' than the others.
- jhawk28 13y agoBased on the disruptor paper (http://disruptor.googlecode.com/files/Disruptor-1.0.pdf http://disruptor.googlecode.com/files/Disruptor-1.0.pdf) linked lists make poor queues also. Ring buffers backed by arrays are much better.
- theboss 13y agoVery interesting, but I feel there is a difference of need here. You're right...there a Ring buffer with an array is better, but for average programmers a linked-list makes a damn good (maintainable, easy, understandable, and pretty quick) queue.