You are viewing a single comment's thread. Return to all comments →
This algorithm isn't O(sqrt(n)), though; since n should be the size of the input not the number itself. The algorithm is exponential on the size.
Seems like cookies are disabled on this browser, please enable them to open this website
Time Complexity: Primality
You are viewing a single comment's thread. Return to all comments →
This algorithm isn't O(sqrt(n)), though; since n should be the size of the input not the number itself. The algorithm is exponential on the size.