I would like to know some solutions to such a problem.
It is given a number lets say 16 and you have to arrange a matrix this way
1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7
the language doesn’t matter, (preferably PHP);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
[EDIT: Update] If language doesn’t matter:
Go to: http://rosettacode.org/wiki/Spiral_matrix
In PHP:
Here you go: