The SparseCollections library provides the SparseArray<T> and SparseMatrix<T> collection classes. The array class allow statements such as "array[1000000] = 5" or "array[-1000000] = 6" without having to create a large array. The matrix class does the same thing using a two-dimensional-array metaphor.
$ dotnet add package SoftCircuits.SparseCollectionsNo README available.