O(1) constant space
easy 14 minO(1) space means an algorithm uses a fixed amount of extra memory, a few variables, no matter how large the input is.
Where it shows up
The same pattern appears across everyday software.
Embedded and memory-tight devices
Microcontrollers in sensors, cars and appliances may have a few kilobytes of RAM. Firmware processes readings as a stream with running averages, minimums and maximums, because storing every sample is impossible.
Streaming analytics
Monitoring systems compute counts, sums, min, max and running means over endless event streams. Each metric keeps a handful of numbers per time window instead of the raw events, which is what lets them scale to millions of events per second.
In-place sorting and partitioning
Heap sort sorts with O(1) extra space, and quicksort's partition step rearranges elements in place with two pointers. Libraries pick these when memory matters more than stability.
Cycle detection in practice
Floyd's tortoise and hare, and Brent's variant, find cycles in linked structures and in iterated functions, such as checking a pseudo-random number generator's period or Pollard's rho factoring, using only two pointers.
Reversing and rotating buffers
String libraries reverse character buffers in place, and text editors and ring buffers rotate data with the three-reversal trick, so no second buffer has to be allocated.