Prime factorization of a number

preview_player
Показать описание
See complete series on maths problems here:
Feel free to drop your questions in comments.
Рекомендации по теме
Комментарии
Автор

One of the best programming channel. Great job, i hope and wish that you are going to start posting videos again (I know it s a lot of work behind). Thank you Sir.

mihaisuciu
Автор

This was exactly what I needed. Thank you!

xanrd
Автор

Correction.!

While writing code... Store the value of n in a separate variable. Because, inside while loop, we are continuosly decreasing it's value and. And once you come out of the while loop and go up in the for loop. The value of "n" Is decremented.

So, right thing to do is store value of 'n' in a separate variable. And use it for the 'for' loop. And use the actual 'n' everywhere inside the for loop.

pratyushpal
Автор

One of the best channel for code learning

enigmaamgine
Автор

Very nicely explained, but by setting n explicitly inside the while loop you prevent the for loop from continuing to the next i. In the example of 6, the algorithm will return 2^1 instead of 2^1 and 3^1 (because n has been reduced to 2 which breaks the for loops rule that i must be less than n, which is now set as 2).

dhariri
Автор

correction at 9:14 ? i does NOT become greater than n (n=44) at i =12, the condition to exit loop. Rather I think the presenter meant to say i becomes greater than n / 2, which is also valid reason to exit for-loop.

cesarjom
Автор

BRO, hablo español, pero en verdad, llevo mucho tiempo buscando un tutorial completo de este tema, para poder mejorar la complejidad en un código, y además de que tu pseudocódigo me ayudo a mejorar el mió, lo explicaste todo muy bien!, en verdad muchas gracias, tienes un nuevo suscriptor

moonvanestar
Автор

in the "worst case" while doesn't play a role and we get O(root n).
How can we be sure that in all the other "non worst cases" even though while will be involved we wont get more than O(root n)?
i do get it somewhat but not completely
tnx

AniketTomar
Автор

6:07 I am fascinated and excited and I am in joy that you are going to answer my question, I am struggling to understand...

sagaralwani
Автор

first time I am interested in algorithms because of you, thanks.🙏

adityamore
Автор

but, I have little bit a confusion that, first for(int i = 2; i<n ;i++) but why are using i<=n ??

ajoydev
Автор

thank you so much. Excellent explanation

kushalavardhan
Автор

Thank you 😊😊😊 for the wonderful explanation

lomeshdaheria
Автор

thanks sir,  very nice lessons ... those how want really improve thier skills will be amazed by ur vedios ... thanks but sir add up some more videos on algorithems and Java language... thanks I am also B.Sc  student thanks...

ahmadahmadi
Автор

very nicely explained sir, but i didn't get how in the worst case the inner while loop will execute only once...

shubhamAgrawal
Автор

Thanks sir but I believe that if n is prime the while loop won't execute except if i=n it will run once, is this true ?

aziz
Автор

Hello, can someone type the coding on the left I'm finding it a bit confusing

Nick-oedq
Автор

thankyou very much i understand this very clearly

AdrianFI
Автор

Thank you so very much sir, really helped a lot.

kalyanitewari
Автор

your primeFactorization function stops when i is 6 (n is given as 44).. correct?

whereismycheese