Imagine this code:
def code(n):
a = range(n)
b = list(a)
return b
Am I correct to say that:
range(n)
takes O(1) time (callingrange
in Python is constant time, right?)list(a)
takes O(n) time, and- The
return
statement takes O(1) time?