from typing import List
def recfunc(xs: List[int]) -> List[int]:
if len(xs) < 2:
return xs
a = list()
b = list()
for x in range(len(xs)):
if x < len(xs) // 2:
a.insert(0, x)
else:
b.insert(0, x)
return recfunc(a) + recfunc(b)
The space complexity for this function is S(n) = S(n/2) + c1*n + c2 for n>=2 where S stands for the space and c1,c2 are some constants.
Why isn't it S(n) = S(n/2)*2 + c1*n + c2?