Advanced Topic 41 of 51 Theory & Discrete Math
Space Complexity Classes
PSPACE, L and related memory-bounded classes.
How it works
Space complexity classes measure memory instead of time. L is solvable in logarithmic extra space, NL by nondeterministic logarithmic space, PSPACE in polynomial space and EXPSPACE in exponential space. Savitch's theorem shows that nondeterministic space s can be simulated in deterministic space s squared, so PSPACE equals NPSPACE, and the Immerman-Szelepcsenyi theorem shows NL equals co-NL. Known inclusions are L within NL within P within NP within PSPACE.
Where it is used
Graph reachability is NL-complete, and games and planning problems, such as generalized chess and quantified Boolean formulas, are PSPACE-complete. Streaming algorithms are constrained by small space.
Common pitfall
Space can be reused whereas time cannot, so space classes are relatively powerful. Confusing the input size with working memory, which is the extra space not counting the read-only input, is a common mistake. Do not assume low time implies low space. Recursion consumes stack space that must be counted. Learn canonical complete problems for each class.
Where it fits in the course
Space Complexity Classes is topic 41 of 51 in Theory & Discrete Math, rated Advanced. It follows SAT Problem. The next topic is Randomized Complexity.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Theory & Discrete Math quiz.
- Explore the Growth Rates (Big-O) visualizer: Chart O(1) to O(n!) as n grows.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Theory & Discrete Math quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Space Complexity Classes?
Where do people use Space Complexity Classes?
What is the most common mistake with Space Complexity Classes?
What should I learn before this topic?
How can I practice it?
Is Space Complexity Classes hard to learn?
How long does it take to learn Space Complexity Classes?
Which topics are related to Space Complexity Classes?
What should I study after Space Complexity Classes?
Related topics
- SAT Problem (Theory & Discrete Math)
- Randomized Complexity (Theory & Discrete Math)
- P vs NP (Theory & Discrete Math)
- Approximation and Inapproximability (Theory & Discrete Math)
- Space Complexity (Algorithms)
- Time Complexity (Algorithms)
- Classes and Objects (Programming Fundamentals)