An algorithm is a sequence of instructions.
results only apply to
instead: consider and analyze algorithms on an abstract machine
Need precise model of machine (costs), input data and algorithms
worst-case performance: consider the worst of all inputs as our cost metric
best-case performance: consider the best of all inputs as our cost metric
average-case performance: consider the average/expectation of a random input as our cost metric
The machine model decides
Goal: Machine models should be
unlimited memory MEM[0],MEM[1],MEM[2],…
fixed number of registers 𝑅1,…,𝑅𝑟
memory cells MEM[𝑖] and registers 𝑅𝑖 store 𝑤-bit integers, i. e., numbers in [0…2𝑤 − 1] 𝑤 is the word width/size; typically 𝑤 ∝ lg 𝑛 ⇝ 2𝑤 ≈ 𝑛
Instructions:
Cost: number of executed instructions
A random-access machine is a bit like a bare CPU . . . without any operating system
All high-level programming languages add memory management to that:
We will mostly ignore how all this works in COMP526.