A prime number has no factors besides 1 and itself. Do the following:
a. Write a program to determine if a positive integer N is prime. In terms of N, what is the worst-case running time of your program?
b. Let B equal the number of bits in the binary representation of N. What is the value of B?
c. In terms of B, what is the worst-case running time of your program?
d. Compare the running times to determine if a 20-bit number and a 40-bit number are prime.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here