We should compare time complexity. The function is f1(n) = n * c
, the equivalent f2(n) = Sum[1->n] c
.
The complexity for multiplication is O(1)
(constant time, one calculation for any n
), the complexity for addition is O(n)
(linear time, number of additions is equal to n).