Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

1 Answer
Monica Mona

Space Complexity

Space complexity is an amount of memory used by the algorithm (including the input values of the algorithm), to execute it completely and produce the result.

We know that to execute an algorithm it must be loaded in the main memory. The memory can be used in different forms:

  1. Variables (This includes the constant values and temporary values)
  2. Program Instruction
  3. Execution

Auxiliary Space

Auxiliary space is extra space or temporary space used by the algorithms during its execution.

Memory Usage during program execution

  1. Instruction Space is used to save compiled instruction in the memory.
  2. Environmental Stack is used to storing the addresses while a module calls another module or functions during execution.
  3. Data space is used to store data, variables, and constants which are stored by the program and it is updated during execution.
Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.