algorithm design lecture notes 3121774