merge-sort(L):
if L.length <= 1:
return L
mid = L.length // 2
left = merge-sort(L[:mid])
right = merge-sort(L[mid:])
return merge(left, right)
merge(left, right):
# todo
-
- is the level of the recursion tree
- is the number of subproblems at level
- is the cost per subproblem at level
- is the total cost of all levels