7. Limitations of Experiments
• In order to compare two algorithms, the same hardware and software environments
must be used.
• Results may not be indicative of the running time on other inputs not included in the
experiment.
8. Theoretical Studies
• Uses a high-level description of the algorithm instead of an implementation.
• Allows us to evaluate the speed of an algorithm independent of the hardware/software
environment.
• Characterizes running time as a function of the input size, n.
• Takes into account all possible inputs
10. Random access machine (RAM)
An idealized notion of how the computer works
Since we have different computers, we need to think of
one computer abstract computer model for its
theoretical analysis.
11. Details in RAM
• A CPU
• An potentially unbounded bank of memory cells. Each of which can hold an
arbitrary number or character
• Memory cells are numbered and accessing any cell in memory takes unit time.
12. Primitive Operations
• Basic computations, like +, -, *, %, <, >, =, ++, --
• Assigning a value to a variable
• Indexing into an array
• Calling a method
• Returning from method
13. Big-Oh Notation
A set of functions with an increase rate equal to or less than this execution time.