Sieve of Eratosthenes ( Algorithm for prime numbers)

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Algorithm for finding out prime Numbers from 1 to n.
    Code GitHub Link :- git.io/JkWFB

Komentáře • 45

  • @miqueasgamero7270
    @miqueasgamero7270 Před 4 lety +9

    Super clear the way you've explained it. Thank you

  • @dhruva1221
    @dhruva1221 Před 4 lety +9

    Brilliant & simple short to grasp easily compared to code school & gaurav sen youtube channels :)
    Thank you a lot!

  • @muhammadminhas5204
    @muhammadminhas5204 Před rokem +2

    nice sir, you've saved our time..... thumbs up to your efforts

  • @husseinnathwani6565
    @husseinnathwani6565 Před 5 lety +6

    I miss Eratosthenes .

  • @shwethashenoy777
    @shwethashenoy777 Před 3 lety +1

    first I am getting confused then I see your video I am getting to know.about it and Thank you sir for explaining it.

  • @CSE150KALLADEVIPRASAD
    @CSE150KALLADEVIPRASAD Před měsícem

    Excellent explaination sir ,also can you make a video on sliding window technique

  • @gouthamganesan9565
    @gouthamganesan9565 Před 4 lety +6

    Vivek, your video is very helpful. But it has the same problem our Indian education system has. We always learn how to do something. But we are never thought why. You just stated the rules, that we should only consider upto the sqrt of the number. But you haven't explained why it is the way it is. This is what we want. We want to understand how things work. Not just how to do things.

    • @shubhamlahoti9758
      @shubhamlahoti9758 Před 4 lety

      Maybe watch some other video for that. No one should ideally spoon feed the 'why? why not? what if it does not?' of every topic. You can always google or ask on stack overflow.

    • @MuzicalMelody
      @MuzicalMelody Před 4 lety

      what are the numbers that exactly divides the number...?
      Sol: Let's take n=20
      We will find by writting i

  • @bhoomika.t.hbhoomi2292
    @bhoomika.t.hbhoomi2292 Před 6 lety +1

    Super ...sir u explained clearly i understand very clearly..tq u sir

    • @user-ko2me2gw5s
      @user-ko2me2gw5s Před 6 lety

      let's say that we keep increasing i, thus i = 11, which is the first not marked i after 7 . Checking 11*2 = 22, this number is marked, because we already marked every x*2 number. Checking 11*3 = 33, this number is marked too, and the reason of that is the same. Continuing we find out that every 11*x where x < 11 is marked. Let's check 11*11, but wait, we need to check numbers [1;50], and clearly 11*11> 50. Thus for every y we need to check y*x numbers where x>=y ,so i need to be in range [1:sqrt(n)].

  • @abhishekjaiswal2687
    @abhishekjaiswal2687 Před 6 lety +3

    Thank you sir..very helpful video

  • @marveldcmaheshtg5384
    @marveldcmaheshtg5384 Před měsícem

    Thank you very much sir

  • @bhavivlogsandsports4405
    @bhavivlogsandsports4405 Před 3 lety +1

    Nice explanation

  • @it_suryawanshisoham1998
    @it_suryawanshisoham1998 Před 4 lety +2

    how you got that we have to take square root of n

  • @sholihatulrichas9414
    @sholihatulrichas9414 Před 6 lety +2

    clear explanation, thank you!

  • @pathe6158
    @pathe6158 Před 3 měsíci

    thank you sir 😊

  • @barzilaizio5833
    @barzilaizio5833 Před 7 lety +4

    thank you sir

  • @user-td7xp9yl5d
    @user-td7xp9yl5d Před 9 měsíci

    thanks sir day after tomorrow is my semester final thank you

  • @MAHESHMALWADE
    @MAHESHMALWADE Před 7 lety +1

    very good explanation..thank you

  • @daddy3409
    @daddy3409 Před 7 měsíci

    Crazy bro love you

  • @jaysahu357
    @jaysahu357 Před 7 lety +1

    Very nice sir

  • @bintaldrammeh9638
    @bintaldrammeh9638 Před 3 lety

    Thank you sir I understand it today

  • @tv..6531
    @tv..6531 Před 3 lety +1

    czcams.com/video/0ABnO_WoexE/video.html
    를 이용하여
    1부터 1,000까지 사이에 있는
    소수의 개수(counting prime numbers)를 구하는 영상 입니다.

  • @yasirarafat9279
    @yasirarafat9279 Před měsícem

    Thanks.

  • @reyou7
    @reyou7 Před 5 lety +2

    amazing!

  • @balkrishnatalele3408
    @balkrishnatalele3408 Před 3 lety +1

    There is so much to learn from you Vivek, All videos are beneficial. Appreciate for putting it all together. The algorithm code you pasted over git has too much complexity and the time complexity could also go wierd.
    Can the below code fit?
    void primeNumbers(int num)
    {
    int i=0;
    for(i=2;i

  • @1skazhar
    @1skazhar Před 5 lety +1

    Thank you

  • @subrata271
    @subrata271 Před 4 lety +1

    simple rule find prime no "6n+/-1"

  • @codewithkolhar3131
    @codewithkolhar3131 Před 4 lety +1

    nice 1.

  • @matitiudeforever8155
    @matitiudeforever8155 Před 6 lety +1

    nice !! thank you

  • @Seema-zs3dq
    @Seema-zs3dq Před 4 lety +1

    Sir please explain in hindi

  • @kusumjoshi3946
    @kusumjoshi3946 Před 5 lety +2

    Sieve of erotosthnese have counting 1 to 100

  • @noumanamjad1016
    @noumanamjad1016 Před 5 lety +1

    2to7 lea

  • @esraamohamed5601
    @esraamohamed5601 Před 5 lety +1

    Awesome!

  • @hey9603
    @hey9603 Před 2 lety

    try out skin care

  • @nirbhaykumarpandey8955
    @nirbhaykumarpandey8955 Před 5 lety +2

    Not most efficient. Why considering even numbers ?

  • @seemayadav5055
    @seemayadav5055 Před 5 lety +1

    .

  • @chetanputtappanavar3425
    @chetanputtappanavar3425 Před 7 lety +3

    Thank you very much sir