Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
For example,
Given n = 3
,
[ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ]
Spiral Matrix II,布布扣,bubuko.com
原文:http://blog.csdn.net/icomputational/article/details/20771135