title: Is there a way other than Array / ArrayList for saving elements of matrix
body: <p>Suppose we have integers as following:
      <code>(1, 2)=10,</code>
      <code>(2,3)=20,</code>
      <code>(3, 4)=30</code>
  etc…</p>
  
  <p>These integers are distributed in a matrix with <code>2000*2000</code> dimensions.</p>
  
  <p>But I just need 4000-6000 elements of this matrix with their indexes (i.e their position (i, j)). Other elements in matrix are zero. So I don’t need them. 
  Is there a good way other than using two dimensional Array/ArrayList, for saving these elements with their indexes, since we can call and reuse the elements and their indexes easily? </p>
  
  <p>Using Array/ArrayList consume alot of memory.</p>