It seems that in python 3 the check time to evaluate:
if x in range(n)
should be O(1), is it? Can you point me to some documentation?
(In 2.7 ranges are lists so there the time complexity is surely linear)
It seems that in python 3 the check time to evaluate:
if x in range(n)
should be O(1), is it? Can you point me to some documentation?
(In 2.7 ranges are lists so there the time complexity is surely linear)