below is code to find prime factors of a given no.
if no prime factors then nothing printed
Pls check whether the code is fully optimized !
below is code to find prime factors of a given no.
if no prime factors then nothing printed
Pls check whether the code is fully optimized !
hello @prerak_semwal
there is no need of preparing sieve, u can direclty iterate from 1 to sqrt(n) and then look for prime factors.
O(sqrt(n)) will be the time complexity
I forgot to mention…in this code we have do “prime-factorisattion using sieve” as per the video lecture.
In that case is my code optimised ?
i m talking about prime factoriasation only , ur solution is correct but there are more efficient solution as well.
i have shared the same in my previous response.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.