Hi I have an algorithm for which I would like to provide the total runtime:
def foo(x):
s = []
if(len(x)%2 != 0):
return false
else:
for i in range(len(x)/2):
//some more operations
return true
The loop is in O(n/2) but what is O() of the modulus operation? I guess it is does not matter much for the overall runtime of the Algorithm, but I would really like to know.