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


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.

Nov 23, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here