In Progress
Lesson 4, Topic 1
In Progress

# Space Complexity

##### Akash
Lesson Progress
0% Complete

The space complexity of an algorithm is the amount of memory it needs to run to completion.

The space needed by each of these algorithms is seen to be the sum of the following components:

1.A fixed part that is independent of the characteristics(e.g.,number, size)of the inputs and outputs. This part typically includes the instruction space(i.e., space for the code), space for simple variables and fixed-size component variables(also called aggregate), space for constants,and soon.

2.A variable part that consists of the space needed by component variables whose size is dependent on the particular problem instance being solved, the space needed by referenced variables(to the extent that this depends on instance characteristics), and the recursion stack space (in-so far as this space depends on the instance characteristics).

The space requirement S(P) of any algorithm P may therefore be written as S(P)= c+Sp(instance characteristics), where c is a constant.