ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Program To Find All The Prime Factors Of A Number | FREE DSA Course in JAVA | Lecture 13

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ส.ค. 2024
  • Data Structures and Algorithms Free Course (Learn DSA Without Paise) Playlist - • Data Structures And Al...
    We are up with the lecture 13 of our much awaited dsa course in java.
    This is the last lectured of the mathematics module of our data structures and algorithms course in Java.
    In this lecture we will learn the logic to find all the prime factors of a given number.
    And ultimately the code and program to find the prime factors of a given number.
    Check out the complete lecture to know more.
    Subscribe to our channel for regular updates on the dsa course and click on the bell icon to never miss an update from our dsa course.
    For more information, fill this form: forms.gle/8eiU...
    or call us at 8884881203
    Facebook: / thetapacademy
    Instagram: / tapacademy_online
    Linkedin: / 73820805
    Website: www.thetapacad...​
    #dsa #dsacourse #java #dsainjava #javaprogramming #coding #coder

ความคิดเห็น • 17

  • @diyasharma6540
    @diyasharma6540 10 หลายเดือนก่อน +8

    Why is this channel underrated? sir teaches so best. Anything he teaches goes straight to my mind and that’s just because sir’s clarity in explaining. Thanks sir!!!!❤❤❤❤

  • @_gamer_u_know
    @_gamer_u_know 2 หลายเดือนก่อน

    thanx a lot sir it helped me a lot

  • @rajeshgoswami885
    @rajeshgoswami885 ปีที่แล้ว +2

    gajab padate ho sir , 1 number

  • @RS-vu5um
    @RS-vu5um 5 หลายเดือนก่อน

    Excellent explanation. Appreciate your efforts.

  • @shhivanshh
    @shhivanshh 3 หลายเดือนก่อน

    There is another approach, similar to the second approach but it has time complexity of O(root(n)). Following is the code:
    int i =2;
    int root = (int) Math.sqrt(n);
    while(i1){
    System.out.println(n);
    }
    This works same as the second code the only difference is we are using if else instead of nested while loops which helps in further decreasing the time complexity from O(root(n)logn) to O(root(n)).

  • @shaikhanis1532
    @shaikhanis1532 ปีที่แล้ว +2

    🤙🤙💥💥💫 good Explanation sir.
    lectures

  • @scottcooper3107
    @scottcooper3107 11 หลายเดือนก่อน

    I'm here just to see the algorithm. I liked how you started with a simple algorithm and then you optimized the algorithm. Well explained. Thank you. Only other optimization that I can see, is maybe only check n with odd numbers after n has been checked with 2.

  • @user-wv1ol1hj8t
    @user-wv1ol1hj8t 10 หลายเดือนก่อน

    what a explation sir

  • @factunplugged
    @factunplugged ปีที่แล้ว +1

    Sir I am very helpful for god-tier explanation. I am hoping to learn DSA completely through your videos and going to share your channel to all of my friends.

    • @TAPACADEMY
      @TAPACADEMY  ปีที่แล้ว +3

      So nice of you. Do recommend Tap Academy in your community. It will be great if you can share our channel in your whatsapp groups amongst your friends.

  • @vamsikattamudi6560
    @vamsikattamudi6560 2 หลายเดือนก่อน

    It never work for few numbers. Ex: 91

    • @vamsikattamudi6560
      @vamsikattamudi6560 2 หลายเดือนก่อน

      Never work for multiples of any 2 prime numbers like 6, 14, 15, 21 etc

  • @TheAlirezak
    @TheAlirezak 7 หลายเดือนก่อน

    then why it does not includes 1 when you type 19 , it should be (19 , 1)no ?

    • @believeinmiracles9383
      @believeinmiracles9383 7 หลายเดือนก่อน

      1 is not a prime number.
      If u still want 1 then u can just add a if condition.
      if(n>1) then print 1.

  • @prasoonlall9432
    @prasoonlall9432 6 หลายเดือนก่อน

    It gives output as 13 for input 130. i value does not exceed the square root of 130 i.e.11.4 ~ 11 & last prime factor is 13. Kindly check . Better to keep time complexity as NlogN & revert to previous condition of while(n>1)

    • @devrajpandey3343
      @devrajpandey3343 6 หลายเดือนก่อน

      Kindly recheck your code for input 130,output will be 2,5,13

    • @OODevelopers
      @OODevelopers 5 หลายเดือนก่อน

      130 is not a prime number . It's a composite number. As per program in first while condition we are checking i square less than or equals to n not i less than or equals to root of n.so it works fine.