Each prime number p will have to mark N/p numbers as prime. So total markings are:
where P is the largest prime smaller than N.
Taking N common
We know
Assuming worst case where P = N
The time compelxity of Sieve of Eratosthenes is
Last updated 3 years ago