top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Write code to traverse a NxM matrix in a zig-zag fashion?

+1 vote
307 views
Write code to traverse a NxM matrix in a zig-zag fashion?
posted Jan 7, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+2 votes

Does anyone know how to rotate a 2d matrix circularly for n times in suppose C language...? It would be a lot of help if you could explain with code.

Hint : Each time each row vector needs to be rotated one element to the right relative to the preceding row vector.

+3 votes

Say we have two matrix of m*n and n*t.
Any sample code in C/C++ along with the algorithm would be helpful.

+1 vote

Print an NxM matrix with nw-se diagonals starting at bottom left corner.

Input

1  2  3  4
5  6  7  8
9 10 11 12

Output

9
5 10
1 6 11
2 7 12
3 8
4
...