156k views
3 votes
What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?

Note: The log is base 2.[1] O(1)[2] O(logN)[3] O(N)[4] O(N logN)[5] O(N*N)

User Srohde
by
8.8k points

1 Answer

4 votes

Answer:

O(n)

Step-by-step explanation:

it's an array of N numbers so worst case scenario is N time

User Cdmdotnet
by
8.1k points