List<T>
The .NET growable array: items keep their order, reading by index is constant time, and searching by value walks the whole list.
In more detail
It is the everyday collection for an ordered group of items. Return IReadOnlyList<T> from services so callers cannot change the list you own.
Related terms
- collection — An object that holds a group of items, such as a list, dictionary, set or array.
- IReadOnlyList<T> — A .NET interface for an ordered collection that can be read by index and counted, but not changed.
- array — A sequence of same-sized slots stored one after another in a single block of memory, so any slot can be reached by its index directly.
- time complexity — A description of how the amount of work an algorithm does grows as its input gets bigger.
Taught in
- What is .NET? Runtime vs SDK, and LTS vs STS — Modern .NET Core, C# & Enterprise Microservices
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices
- Async and Await: Managing Concurrency — Modern .NET Core, C# & Enterprise Microservices