We will continue talking about sorting and algorithmic
analysis.
# To prepare for lecture:
We will talk about selection sort and insertion sort, including their
implementation in Python code and their run times algorithmically
speaking. The following videos give high level descriptions:
- Selection sort in 3 minutes
- Insertion sort in 2 minutes
In the last few seconds of each video the presenter mentions the big-O
running time of each algorithm. You can watch the following, which is
his short video introducing big-O notation, but it's ok if you don't.
I will talk about it more.
- Big-O notation in 5 minutes -- The basics
Finally, in case this matches with your learning style, the following
videos present the algorithms in dance form:
- Select-sort with Gypsy folk dance
- Insert-sort with Romanian folk dance
# Notes from after lecture:
First, my apologies for not starting to record until we were already
30 minutes into the lecture (and thank you to the anonymous person who
pointed this out to me!). The video is missing the discussion of
selection sort and the first part of the discussion on insertion sort.
These are both standard sorting algorithms, so if you missed the cs51p
lecture I would suggest watching the videos above and then taking a
look at the pdf notes and the code from today.
- The marked up version of the notes is
here. The code
is here.
- The video is on Box and
available here.
- Assignment10 is available on piazza as well
as here.