Time Complexity: Primality

  • + 7 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.