I would use List<T>
because all of your data will be stored sequentially if they're value types and still do well with reference types (internally, List<T>
manages an array that it grows by a factor of two each time you run out of space).
LinkedList<T>
used to make a lot more sense when things weren't IO bound. People will often quote its seeming "O(1)" nature. However, this discounts the true cost that comes with increased chances of page faults getting the nodes.
If you can get contiguous memory regions with an array or List<T>
and avoid the potential of a page fault, you're much better off with modern processor and main memory caching lines.
If you know how many elements in advance you'll have, use an array. If you have a good idea of how many elements, use a List<T>
(and in the constructor pass the likely upper bound to potentially avoid a reallocation).
The only time I'd use a LinkedList<T>
is if you need to bump items in a list by one value constantly. For example, if you're implementing a least recently used cache algorithm and need to add something to the front and take something off the end.
For small items, it really won't make a difference. The generational garbage collector will compact scattered heap items together over time so the linked list won't get too bad.
I'd pick a List<T>
and run with it unless you noticed problems (via profiling)