Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 2.79 KB

File metadata and controls

71 lines (50 loc) · 2.79 KB
date duration maintainer order title
w3d2
50
artificialsoph
2
Complexity Intro

Sample Lesson Plan

Learning Objectives

Students should be able to:

  • Explain the value of complexity analysis and how it would be applied to projects in theory.
  • Apply complexity analysis to their existing and futoure work.
    • Meaure the wall clock time of real code.
    • Programmatically measure wall clock time of real code.
    • Use a line profiler to check and inform big-O complexity analysis.
  • Use the heuristic method to find Big-O complexity

Depends On

Python Review

Intro to Matplotlib

Instructor Notes

Very important Before starting this, update the notebook to use solutions that students have submitted for pair problems so far. I've included two pairs often taught in the first week (Reverse String and Can You Spell) but you may be teaching something different. If so, update the solutions in the notebook.

This lecture teaches a heuristic method for finding the big-O complexity of an alorithm. At the end of the slide deck is an optional component with an example of using a proof.

Additional Resources

Details

Cracking the Coding Interview

  • High level, assumes familiarity already
  • Touches on space complexity
  • Good review questions

Chad's lecture notes

  • Dives in w/ examples
  • Better academic coverage
  • Tradeoff between maintainability and complexity

USF CS 245 lecture notes

  • From David Galles
  • Touches on benchmarking algorithms
    • Wall clock vs mathemtatical model
  • Touches on space / time trade off
  • Discussion of best, worst and average
  • Comparison of linear vs binary search
  • Big O
    • Leading terms, dropping constants
  • General guidelines
  • A handful of examples

Rob Bell's blog

  • Describes each common complexity