Diagonal Difference

  • + 0 comments

    Performing constant time operations n2 times (the number of iterations of the loop) is, by definition, not trivial when discussing running time. The act of saving data to an array could be considered trivial, because it's an additional O(1) time operation within the loop.