Are You A Prime Number

后端 未结 11 2188
甜味超标
甜味超标 2021-02-10 07:39

I\'ve been interested in the problem of finding a better prime number recognizer for years. I realize this is a huge area of academic research and study - my interest in this i

11条回答
  •  不知归路
    2021-02-10 07:59

    There is no way to improve the algorithm. There may be tiny ways to improve your code, but not the base speed (and complexity) of the algorithm.

    EDIT: Of course, since he doesn't need to know all the factors, just whether or not it is a prime number. Great spot.

提交回复
热议问题