Sparse Arrays (Cont.)
An m ? n array normally requires storage locations.
If m = 1000 and n = 1000 and each item requires 8 bytes, then about 8 MB are needed for this.
What if 99% of these contain the number 0 ?
We could save space by keeping not a full array, but a list of the non-zero entries.
? ? 321, 522, 0.1 ?, ? 759, 194, 0.09 ? ?