I
indian_gaurav
Let A be an array of (n) elements. Write a procedure which will také
this array as input and return a matrix which will be spiral in
nature. i.e.
if A= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] then
fn(A)= B
=
7 8 9 10
6 1 2 11
5 4 3 12
16 15 14 13
although i could easily handle the problem for a 2 dimension matrix
the problem has to be solved in 3 dimension as well as n dimension.
i'm finding it difficult to visualize the same problem for 3 dimension
and then for n dimension.
can som1 help me?
thank u
Gaurav
Plz write to (e-mail address removed)
this array as input and return a matrix which will be spiral in
nature. i.e.
if A= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] then
fn(A)= B
=
7 8 9 10
6 1 2 11
5 4 3 12
16 15 14 13
although i could easily handle the problem for a 2 dimension matrix
the problem has to be solved in 3 dimension as well as n dimension.
i'm finding it difficult to visualize the same problem for 3 dimension
and then for n dimension.
can som1 help me?
thank u
Gaurav
Plz write to (e-mail address removed)