title: Algorithm to minimize the space complexity of a sparse matrix?
body: <p>When storing and manipulating sparse matrices on a computer (zeros and ones), it is beneficial and often necessary to use specialized algorithms and data structures that take advantage of the sparse structure of the matrix. Operations using standard matrix structures and algorithms are slow and consume large amounts of memory when applied to large sparse matrices. Sparse data is by nature easily compressed, and this compression almost always results in significantly less memory usage. </p>
  
  <p>You are given a two dimensional matrix where the number of rows are known in advance (You can select any number between 30-256). The number of columns is very, very big. You can think of 10<sup>6</sup> columns. Each column has exactly 1 value of one.</p>
  
  <p>Write an algorithm that minimizes the space complexity of this matrix. You can show how your algorithm works and even write a program.</p>