今天听一友人说了一道在google的面试题,题目是这样的:有一个M*N的矩阵,要求你以“Z”字型遍历矩阵。例如,如果输入为5*10的矩阵:[00,02,03,09,10,19,20,29,30,39][01,04,08,11,18,21,28,31,38,40][05,07,12,17,22,27,32,37,41,46][06,13,16,23,26,33,36,42,45,47][14,15,24,25,34,35,43,44,48,49]则输出为:00,01,02....48,49。再如...
查看全文