The RAM model is a simplified computer with one processor and uniform random-access memory. It lets you compare algorithms without depending on CPU speed, multitasking, parallelism, or hardware memory layers. section 4.6
The model assumes:
- Any memory location can be accessed in one operation, regardless of its position. section 4.6
- The processor provides a small set of arithmetic, data-movement, and flow-control instructions. section 4.6
- Each basic instruction takes constant time, written as O(1). section 4.8
Why it matters
Under the RAM model, binary search is associated with logarithmic growth, linear search with linear growth, and handling every subset of an array with exponential growth. These classifications describe how running time or memory changes as input size increases. section 4.16
