top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

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

+1 vote
625 views

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
posted Jul 5, 2016 by anonymous

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

Similar Questions
+3 votes

Given a binary tree print it in inward spiral order i.e first print level 1, then level n, then level 2, then n-1 and so on.

For Ex -

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

Print- 1 15 14 13 12 11 10 9 8 2 3 7 6 5 4

+2 votes

How to sort elements in a matrix that are above the principal diagonal using C/C++, diagonal elements are also included?

...