This wiki is incomplete.
Space complexity is a term used when dealing with algorithm analysis. It's an expression that describes the amount of memory (space) required to perform the task that the algorithm is expected to solve. For example, insertion sort has a space complexity of O(1), because it doesn't need extra allocation of memory in order to sort the provided collection. In this case we say that the sorting operation is done in-place. Merge sort is different, and it has a space complexity of O(n). That's explained because the implementation of merge sort divides the array in two (this is done recursively) creating a new array (or list) of N/2 at each step. The sorting operation requires the allocation of new space in memory.
Example Question 1
This is the answer to the question, with a detailed solution. If math is needed, it can be done inline: , or it can be in a centered display:
And our final answer is 10.