a space-complexity class
Once we agree to measure memory, we can sort problems into bins by how much memory they need. A space-complexity class is one such bin: it gathers together every language that some machine can decide while staying within a given memory budget. If time classes answer 'what can you do in this many steps?', space classes answer 'what can you do with this much scratch paper?'. Each choice of budget carves out a different family of problems.
For a function f(n), the deterministic class SPACE(f(n)) is the set of all languages decided by some deterministic Turing machine that uses O(f(n)) work-tape cells on inputs of length n. The nondeterministic class NSPACE(f(n)) is the same but the machine is allowed to guess (a nondeterministic Turing machine), and it accepts if at least one sequence of guesses leads to acceptance, again within O(f(n)) cells. From these two definitions the named landmarks are built: L is SPACE(log n), NL is NSPACE(log n), PSPACE is the union of SPACE(n^k) over all constants k, and so on up the ladder.
Defining classes by a resource bound is the backbone of complexity theory: it lets us state precise questions like 'is L strictly inside NL?' or 'does PSPACE equal NPSPACE?' and then prove some of them. Two honest cautions. First, the bound is an O(...) cap on the worst case, not the exact memory on every input. Second, we usually require f to be space-constructible (the machine can mark off f(n) cells without overshooting), a mild technical condition that the hierarchy theorems lean on; the everyday functions log n, n, n^2, 2^n all satisfy it.
SPACE(n^2) contains every language decidable using at most a quadratic number of work cells. The whole class PSPACE is the union SPACE(n) cup SPACE(n^2) cup SPACE(n^3) cup ... over all polynomials; it does not matter which polynomial, only that some polynomial bound holds.
A space class is the set of languages decidable within a stated memory budget f(n).
The hierarchy theorems need f to be space-constructible. This is a mild condition that all the usual bounds (log n, n, n^2, 2^n) satisfy, not a real restriction in practice.