difference between value of variable and size of variable in big O notation

Viewed 36

I am studying cryptography algorithms. Here we have following algorithm to check primarality test.

def is_prime(x):
  for i in range(2,x):
    if x % i == 0: return False
  return True

On above following is quiz asked Would above approach work
A. Yes
B. No, its running time is exponential in the value of x
C. No, its running time is exponential in the size of x
D. No, there is a silly bug in python code

Answer is given as C.

My question and require help what is difference between value of 'x' and size of 'x'.

Thanks for your time and help

0 Answers
Related