Ad
  • Default User Avatar

    I think it doesn't make it n^2. It is still linear - 2n, if you want. But constants are usually discarded in Big O, so just n. n^2 would be if, for example, for every element of that array there were another array which would be iterated.