Fast prime factorization module

前端 未结 7 1944
萌比男神i
萌比男神i 2020-11-29 15:44

I am looking for an implementation or clear algorithm for getting the prime factorization of N in either python, pseudocode or any

相关标签:
7条回答
  • 2020-11-29 16:41

    Even on the current one, there are several spots to be noticed.

    1. Don't do checker*checker every loop, use s=ceil(sqrt(num)) and checher < s
    2. checher should plus 2 each time, ignore all even numbers except 2
    3. Use divmod instead of % and //
    0 讨论(0)
提交回复
热议问题