Is there an algorithm to print a matrix like this
a[0] a[1] a[5] a[6] ..
a[2] a[4] a[7] ..
a[3] a[8] ..
a[9] ..
a[10]
Is there an algorithm to print a matrix like this
a[0] a[1] a[5] a[6] ..
a[2] a[4] a[7] ..
a[3] a[8] ..
a[9] ..
a[10]
On the assumption you know how big your array is to start, yes. (For every row/column, you can compute what number goes there.)