问题2:以下两个程序,在执行效率上有什么 区别? 对一个二维数组Am:进行遍历 n程序1: a for from 1 to m do for j from 1 to n do A[1,12403]A14A1,5A1,6A17| a do something with Al,J] A[2 1 A(2.2)(2.3.4 A(2.5)A2.6)(2. 7 n程序2: n for j from 1 to n do for from 1 to m do a do something with A[, J问题2:以下两个程序,在执行效率上有什么 区别? ◼ 对一个二维数组A[m,n]进行遍历: ◼ 程序1: ❑ for I from 1 to M do ◼ for J from 1 to N do ❑ do something with A[I,J] ◼ 程序2: ❑ for J from 1 to N do ◼ for I from 1 to M do ❑ do something with A[I,J] A[1,1] A[1,2] A[1,3] A[1,4] A[1,5] A[1,6] A[1,7] … A[2,1] A[2,2] A[2,3] A[2,4] A[2,5] A[2,6] A[2,7] … …