I need to make a "channel list." Users need to be added when they join, and removed when they leave. The number of elements should be, on average, 50. Linked list or dynamic array?
I need to make a "channel list." Users need to be added when they join, and removed when they leave. The number of elements should be, on average, 50. Linked list or dynamic array?
From a C perspective, I would think the only difference would be that the array would be contiguous in storage and the linked list entries could be anywhere.
Do you have a need to traipse through the data super super quickly? If so, a dyn array and pointer arithmetic might be faster than scooting through a linked list. (either way, it's minimal overhead)
My 2 cents.
Last edited by Dino; 10-17-2008 at 12:51 PM.
Mainframe assembler programmer by trade. C coder when I can.
I think the flip side of that is going to be removing people from the middle of the structure: easy in a list, hard in an array (unless you make it a sentinel value and reuse it later).