I was wonder what the time complexity of certain operation in python are:
x = k * l ( multiplication )
x = k/l ( division )
math.sqrt(y)
math.pow(y,f)
and what is the complexity for using a while - loop.
I truly believe it's the same in Python as in every other common languages?
x = k * l # multiplication -> O(n²)
x = k/l # division -> O(n²)
math.sqrt(y) # -> O(M(n))
math.pow(y,f) # -> O(M(n))k), n digits number and k bit exponent
while loop # -> O(n) ,same as For loop.
Edit : For multiplication, Python uses the standard multiplication algorithm O(n²) but for very big numbers, it goes with Karatsuba algorithm, so O(n^1.585) according to wikipedia.