title: efficient way to represent a lower/upper triangular matrix
body: <p>I am working on my data in a C/C++ program, which is 2 dimensional. Here my value is calculated for pair-wise and here values would be same for <code>foo[i][j]</code> and <code>foo[j][i]</code>.  </p>
  
  <p>Thus if I implement it by using a simple 2 dimensional array, half of my space would be wasted. So what would be best data structure to represent this lower/upper triangular matrix.</p>
  
  <p>Regards,</p>