Learning Outcomes
At the end of this lecture, you’ll be able to:
- Describe what is meant by efficiency of algorithms.
- Explain why we use the RAM model of computation for analysis of algorithms.
- Identify what counts as a “step” in an algorithm.
- Explain how algorithm run time is calculated under RAM model of computation.
- Describe run time by counting up the number RAM instructions for a given code snippet.
- Recognize importance of input size on solution efficiency.
- Appreciate what we choose to call the size of an input can vary from problem to problem.
- Differentiate between the best-case vs the worst-case analysis.
- Explain why we focus on worst-case analysis.
- Express the number of steps for a given code segment as a function of the input size in the worst case scenario.
- Appreciate that counting the exact number of RAM instructions requires too much details and it can be very difficult to work out precisely.
Lecture Plan
In this lecture, we'll cover the following lessons:
- Efficiency: A pragmatic definition
- RAM: A Hypothetical Computer!
- RAM: Algorithm Run Time
- RAM: Counting Steps⚡
- Running Time: Size of The Input⚡
- Running Time: Choosing the Input⚡
- Running Time: Best vs Worst Case⚡
- Running Time: Average Case
- Running Time: Exercise⚡
- Running Time: Exercise⚡
- Running Time: It's hard to count precisely!
Lessons marked with ⚡ contain exercise/activity.