Time complexity

Revision en1, by MVernik, 2020-07-13 17:08:59

Confused...


Back-end part: int[][] matrix = new int[n][m]; int[] array = new int[n*m]; traversMatrix(matrix); traversArray(array); Client part: function traversMatrix(matrix : int[][]) for (i..n) for (j..m) doActions(); function traversArray(array : int[]) for (i..array.size()) doActions(); =================================== Time Complexity for traversMatrix: Quadratic Time Complexity for traversArray : Linear? Why?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English MVernik 2020-07-13 17:08:59 511 Initial revision (published)