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.
Say we have two matrix of m*n and n*t. Any sample code in C/C++ along with the algorithm would be helpful.
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