This chapter is relatively short!
Spatial complexity (space complexity) and auxiliary spaces (auxiliary space) are often mixed, and the following are the definitions of the correct auxiliary space and spatial complexity
Auxiliary space: Additional or temporary storage space that the algorithm needs to use.
Spatial complexity: Refers to all the storage space required by the algorithm, which is determined by the size of the input data. The spatial complexity includes the secondary space and the storage space for the input.
If we want to compare the space required for several standard sorting algorithms, it is better to use the auxiliary space to analyze than the space complexity. Merge sort uses the auxiliary space of O (n). The auxiliary space of O (1) is inserted for sorting and heap sorting. But the spatial complexity of their algorithms is O (n).
What is the complexity of space? What does ' Space complexity ' mean? ------Geeksforgeeks Translation