Professional Documents
Culture Documents
4. Consider the nave Monte Carlo algorithm for Primality testing presented in
textbook, where Power(x, y) = xy. What should be the value of t for the
algorithms output to be correct with high probability? Write the code in C and
analyze the observations. [5 marks]
n
5. Show that the complexity for T[n] = T[ 2 + 21] + n) is (nlogn).
[5 marks]