Could you explain me this phrase concerning space complexity?
It is composed of two different spaces; Auxiliary space and Input space.
Could you explain me this phrase concerning space complexity?
It is composed of two different spaces; Auxiliary space and Input space.
Input space is the space occupied by the input of the algorithm. For instance, if the algorithm sorts an array of integers, then the input space is the memory occupied by that array.
Auxiliary space is the space that the algorithm needs on top of that. For instance, a recursive sorting algorithm (like quicksort) will typically use space from the stack. Also the local variables (like a loop variable, or the temporary variable used to swap values, or an array to copy values into) are part of this auxiliary space.