Space Efficiency

There are some circumstances where the space/memory used must be analyzed. For example, for large quantities of data or for embedded systems programming.

Components of space/memory use:

1. instruction space Affected by: the compiler, compiler options, target computer (cpu)
2. data space Affected by: the data size/dynamically allocated memory, static program variables,
3. run-time stack space Affected by: the compiler, run-time function calls and recursion, local variables, parameters

The space requirement has fixed/static/compile time and a variable/dynamic/runtime components. Fixed components are the machine language instructions and static variables. Variable components are the runtime stack usage and dynamically allocated memory usage.

One circumstance to be aware of is, does the approach require the data to be duplicated in memory (as does merge sort). If so we have 2N memory use.

Space efficiency is something we will try to maintain a general awareness of.

prev -- next
one page