问题2:以下两个程序,在执行效率上有什么 区别? ■对一个二维数组A[m,n进行遍历: ■程序1: for /from 1 to M do for Jfrom 1 to N do A[1,1]A1,2]A1,3JA1,4A1,5]A1,6jA1,7] do something with A[l,J] A2,1]A2,21A2,3]A2,4]A25]A2,6]A2,7刀… ■程序2: for Jfrom 1 to N do ■for/from1 to M do do something with A[l,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] … …