top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Print an NxM matrix diagonaly starting at bottom left corner?

+1 vote
302 views

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
posted Jan 7, 2017 by anonymous

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

Similar Questions
+1 vote

C: Print the elements of a matrix in anti spiral order?

Input Matrix

1 2 3 
4 5 6 
7 8 9 

Output

5 6 9 8 7 4 1 2 3
0 votes

Write a c program that rotate elements of an array by the value of configured number "n".
For example:
Input array[ ] = { 2, 3, 5, 6, 8, 9}
value of n = 2
Output array[] = { 5, 6, 8, 9, 2, 3}
I am looking for efficient program.

+6 votes

Given binary tree is:

        1
     /     \
    2        3
  /  \        \
 4   5         6
             /   \
            7     8

The output should be 1, 2, 3, 4, 5, 6, 7, 8

...