Question: A recursive function primeR ( n , k ) that checks if n is a prime number has an accompanied a wrapper function isPrime (

A recursive function primeR(n, k) that checks if n is a prime number has an accompanied a wrapper function isPrime(n). The function definitions are as follow:
def primeR(n, k):
if n%k ==0:
return False
if k*k > n:
return True
return primeR(n, k+1)
def isPrime(n):
return primeR(n,2)
What is isPrimeR's Big-0 time complexity?
Question 2 options:
O(logn)
O()
None of the other statements are true
O(n)
The Big-O complexity cannot be calculated since it does not belong to any classes taught in this course

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!