#sparse-array
Wiki
›
Algorithms
›
02. Data Structures
›
1. Core Data Structures and Operations
›
1.1 Arrays and Dynamic Arrays
›
Sparse Array
Sparse Array A sparse array represents a large logical array by storing only positions whose values differ from a default value. Most entries are implicit. You use it when the index space is large but only a small number of positions contain meaningful data. Problem Given a logical array $A$ of length $n$, support reading and writing index $i$ where: $$ 0 \le i < n $$ Most values are...