Which of the following contributes to space complexity?

2025

Which of the following contributes to space complexity?

  1. A.

    Input variables and recursion stack

  2. B.

    CPU clock speed

  3. C.

    Compiler optimizations

  4. 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.

Explore the full course: Rssb Senior Computer Instructor