l.append(5)
O(1)
mostly: ICS-46 covers details
l.pop()
O(1)
same as l.pop(-1), popping at end
l[a:b]
O(b-a)
l[1:5]:O(l)/l[:]:O(len(l)-0)=O(N)
l.extend(…)
O(len(…))
depends only on len of extension
list(…)
O(len(…))
depends on length of … iterable
del l[i]
O(N)
depends on i; O(N) in worst case
l.copy()
O(N)
Same as l[:] which is O(N)
l.pop(i)
O(N)
O(N-i): l.pop(0):O(N) (see above)
min(l)/max(l)
O(N)
linearly searches list for value
for v in l:
O(N)
Worst: no return/break in loop
l.sort()
O(N Log N)
key/reverse mostly doesn’t change
k*l
O(k N)
5l is O(N): len(l)l is O(N**2)