COP 4531: Lecture 2

Learning objectives

After this class, you should be able to:

  1. Given an array, show the steps executed by INSERTION-SORT.
  2. Prove the correctness of insertion sort, using loop invariants.
  3. Write code to implement insertion sort.
  4. Give the asymptotic time complexity of insertion sort.
  5. Given an algorithm similar to insertion sort, prove its correctness and determine its time complexity.

Reading assignment

  1. CLR: Sections 2.1 - 2.2, prepare for the test on pre-requisite materials.
  2. CLR: Chapter 2, pages 29 - 31.

Exercises and review questions


Last modified: 10 Jan 2007