Reputation: 667
I have one algorithm that only needs to run in O(N/2) time (basically it is a for loop that only runs over half of the elements).
How does this simplifies in the big O notation? O(log n)?
Upvotes: 1
Views: 986
Reputation: 24088
Big O notation drops the factors. O(N/2) = O(1/2 * N)
and simplifies to O(N)
.
If you want to know why the factor is dropped I would refer you to this other SO question.
Upvotes: 4