Mid From PDF Collections C# Collections

What are some performance trade-offs when choosing between different collections?

Scenario Best Choice Trade-offs

Fast indexed

ccess

List<T> 	Slower inserts/removes in

the middle

Frequent

insert/delete at

ends

LinkedList<T> No fast indexed access;

higher memory use

Fast lookups by

key

Dictionary<TKey, TValue> 	No sorted order

Sorted key-value

pairs

SortedList<TKey, TValue> or

SortedDictionary<TKey,

TValue>

Slower inserts vs

Dictionary

Thread-safe

multi-thread use

ConcurrentDictionary /

ConcurrentQueue

Slight overhead for

synchronization

More from C# Programming Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details