Day 63: Zig-zag
Zig-zag scan of a matrix is useful when you transform your 2D data between domains and the transformation tends to accumulate information into top left corner.
An example is JPEG image compression with discrete cosine transform, which accumulates energy to the left [in 1D]…