28/32
Part 7 of 7 · Follow-upsLearn and do

What if the grid is too big for memory? Shrink the seen-set first

Another follow-up is about scale: a grid too big to hold in memory.

A 2 by 3 grid in one bytearray, with C = 3
grid
row 0012row 1345
bytearray
012345

Cell (r, c) is at index r * C + c.

Predict

On an open 1,000 by 1,000 grid, a seen-set of (r, c) tuples peaked at 137 MB. About how much does a bytearray with one byte per cell take?

Pick an answer above to see the rest