Which of the following contributes to space complexity?
2025
Which of the following contributes to space complexity?
- A.
Input variables and recursion stack
- B.
CPU clock speed
- C.
Compiler optimizations
- D.
Number of programming languages used
Attempted by 179 students.
Show answer & explanation
Correct answer: A
Space complexity refers to the total amount of memory required by an algorithm during execution. This includes memory used by variables, data structures, function calls, and recursion stacks. Recursive algorithms especially consume additional stack memory for each function call, which contributes to overall space complexity.