L6. Sieve of Eratosthenes | Maths Playlist

preview_player
Показать описание


Find DSA, LLD, OOPs, Core Subjects, 1000+ Premium Questions company wise, Aptitude, SQL, AI doubt support and many other features that will help you to stay focussed inside one platform under one affordable subscription. Have a hassle free one stop solution for up-skilling and preparing.

Рекомендации по теме
Комментарии
Автор

Your explanation is much better than Leetcode editorial

pmanideep
Автор

Sieve of Era&%#.... something like that🤣🤣🤣
Nice Solution👍
Understood

keshavbadhekar
Автор

Understood; I'm improving my thought process in every video; Thank you bro;

trailblazer
Автор

That was crystal clear explanation. Can't thank you enough brother!!!!

Mr.Manoj
Автор

ig in the second for loop there needs to be a correction it will go till j<n not j<=n, else array will be out of bounds

linearmusic
Автор

if your video doesn't exist for a concept, well it sure that we are going to have hell a lot of trouble in getting the intuition

nptelpunith
Автор

Thanks Striver sir, Amazing Explanation. Cleared all my doubts

Non-residential_villager
Автор

date : 15th Feb, at 16.20 PM,
Place: 300L, Girls Hostel 1, NSUT

garimasingh
Автор

```cpp
vector<bool> primes(n+1, 1);
primes[0] = primes[1] = 0;
for (int i=2; i*i<=n; ++i) {
if (primes[i])
for (int j=i*i; j<=n; ++j)
primes[j] = 0;
}
```

kaioz
Автор

IF WE INITIALISE VECTOR LIKE { vector<int> arr(n+1, 1)} DOES IT STILL CONSIDERED AS O(N) TIME???

AkOp-bfvm
Автор

understood and thank you very much !!!

ruparani
Автор

UNDERSTOOD every bit Thank u soo much !!

AdityaSingh-uyms
Автор

Sir I visited your website after Harkirat sir's webinar, But I can't able to singup in takeuforward website also no content showing loading AToZ - DSA page, why is it sir, help me out

NishikantDounekar
Автор

With memset, however, the values are not set to the integer 1; they are set to a non-zero integer (16843009), which is not correct for this algorithm.

Satyam-jetb
Автор

Instead of filling the arrays with one and then changing them to zeros, isn't it better to use the default zero and change it to 1 accordingly?

KeerthiReddyKolan
Автор

Thanks brother, you have got very nice teaching skills

jivrajsinghshekhawat
Автор

just want to say that : Pdh ke Mza aa gya

piyushchauhan
Автор

Here the space complexity is O(n) but we can reduce it to O(n/2) by ignoring the even numbers as all the even numbers are multiple of 2. So we can ignore them.

AkashDas-zeco
Автор

humne vector ko n elements se kyu initilaixe nhi kiya kyuki hume to only prime[n-1] tak hi check krna hai prime[n] tak nhi

shubhanshu
welcome to shbcf.ru