【解题报告】lintcode374螺旋矩阵

题意

螺旋遍历一个矩阵,方向为,右,下,左,上,如此循环

解法

用一个与原数组相同的标记数组来标记已经访问的点,再设置四个函数,处理四种方向的情况,循环调用这四个函数。

代码

u3coding
A software developer

Leave a Comment

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.