Sieve of eratosthenes

Описание к видео Sieve of eratosthenes

The sieve of eratosthenes is one of the most commonly asked mathematical programs for both coding round as well as interviews for placements and internships. While i explained this algorithm, i have showed 2 optimizations with reason and example, which will immensely improve the time complexity of sieve of eratosthenes to NloglogN.This method is used to find all the prime numbers till a given number N. The range to which this sieve algo can find all primes is limited by the memory allocated for the program to run. If you have large memory then you can create large sieve using array and run this algo to find all prime numbers till N. We can also serve range query for prime numbers and return primes in given range of X to Y. CODE LINK is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)


CODE LINK: https://gist.github.com/SuryaPratapK/...


TIME COMPLEXITY PROOF: https://www.geeksforgeeks.org/how-is-...

Комментарии

Информация по комментариям в разработке