Algorithms (CSCI 3104, Fall 2016)

Course Information
  • Class Timings: MWF 11-11:50 AM.

  • Class Location: Fleming 155

  • Instructor: Sriram Sankaranarayanan

  • Teaching Assistants: Wanshan Yang, Ning Gao, and Sebastian Laudenschlager.

  • Course Assistants: Mitchell Block, Michael Condon and Derek Gorthy.

  • Pre-Requisites: Calculus I,II, Data Structures (CSCI 2270) , Discrete Structures (CSCI 2824) and ability to program in Python.

  • Office Hours: We will have the following hours:

    • Agile office hours before class on MWF. Instructor will arrive early to class.

    • Sriram Sankaranarayanan, Thursdays 12:30 - 2 PM, ECOT 831.

    • Derek Gorthy: Mondays 2-5 PM and Wednesdays 5-7 PM (CSEL Lab).

    • Michael Condon: Mondays 5-7 PM, Wednesdays 2-5 PM (CSEL Lab).

    • Mitchell Block: Thursdays 2-6 PM and Fridays 10-11 AM (CSEL Lab).

    • TAs: Before/after class and by appointment.

  • Final Exam: Wednesday Dec 14th, 7:30 - 10:00 PM (See here).

  • August 15, 2016 Course page is live!


Note All assignments posted on moodle. Signup code will be given out in class and sent out by email.

Lecture Schedule and Notes

The schedule of lectures shown below is subject to change. We will post lecture notes for most topics and videos for selected topics. We will strive to post all material well in advance. Please take a look through them, and come prepared for class.

ID Date Topics Covered Book Sections
1 Aug 22 Introduction to Algorithms. Algorithms behind common technologies. Not from CLR
2 Aug 24 Big-O, Big-Omega and Big-Theta notations. ch. 3
3 Aug 26 Time and Space Complexity bounds. ch. 3
4 Aug 29 Divide and Conquer Algorithms: binary search and mergesort. ch. 4
5 Aug 31 Karatsuba and Strassens Algorithm. Setting up and analyzing recurrences. ch. 4.1, 4.2
6 Sep 2 Master method for solving recurrences. 4.5
Sep 5 Labor day holiday
7 Sep 7 Heap data structures and heap sort 6
8 Sep 9 Heaps and heapsort continued 6
9 Sep 12 Quiz # 1 (in-class, 30 minutes)+ Material up to August 29
10 Sep 14 Partitioning: Quicksort algorithm 7.1, 7.3
11 Sep 16 Randomization and Analysis of quicksort 7.2, 7.4
12 Sep 19 Quickselect algorithm for searching 9.1, 9.2
13 Sep 21 Median of medians trick for pivot selection 9.3
14 Sep 23 Linear Time Sorting Algorithms 8
15 Sep 26 Red-Black Trees Properties and Analysis 13
16 Sep 28 Hashtables: hash functions and chaining 11
17 Oct 3 Quiz # 2 (in class 30 minutes) + Material up to Sep 16
18 Oct 5 Hashtables: open address hashtables 11
19 Oct 7 Bitcoins not in book/syllabus
20 Oct 10 Dynamic programming # 1: coin changing problem 15
21 Oct 12 Dynamic programming # 2: memoization 15
22 Oct 14 Dynamic programming # 3: longest common subsequences 15
23 Oct 17 Wrap up of dynamic programming 15
24 Oct 19 Greedy algorithms 16
25 Oct 21 Huffman codes 16
26 Oct 23 Graphs: basic algorithms 22.1, 22.2
27 Oct 24 Quiz # 3 (in class 30 minutes) + Material up to end of Sep. 26
28 Oct 26 Depth first search algorithm and topological sort 22.3, 22.4
29 Oct 28 DFS and topological sort 22.3
Oct 31 No lecture due to travel
30 Nov 2 Strongly Connected Components 22.5
31 Nov 4 Strongly Connected Components (Continued) 22.5
32 Nov 7 Guest Lecture Aleks Chakarov Minimum Spanning Trees (MST) 23
33 Nov 9 Aleks Chakarov Prim and Kruskal's Algorithm 23
33 Nov 11 Aleks Chakarov Wrapup of MST
34 Nov 14 Shortest Path Algorithms: Relax Operation 24
35 Nov 16 Bellman-Ford Algorithm and Negative Weight Cycles 24.1
36 Nov 18 Dijkstra's Algorithm 24.3
37 Nov 28 All pairs shortest path and Floyd-Warshall Algorithm 25.1, 25.2
38 Nov 30 Linear Programming 29.1 - 29.2
39 Dec 2 Overview of Simplex algorithm and more Linear Programming 29.3
40 Dec 5 NP Completeness : A brief overview 34
41 Dec 7 Revision for the final part 1
42 Dec 9 Revision for the final part 2

Course Objectives

The key course objectives are as follows:

  • Learn a set of ‘‘standard’’ or canonical algorithms for computational problem solving. This involves

    • Understanding properties of algorithms.

    • Proving these properties mathematically.

    • Proving rigorous time and space complexity bounds on the performance.

    • Understand the relative merits or demerits of an algorithm, in practice.

  • Apply: Adapt and combine algorithms creatively to solve problems that may arise in practice.

    • Use algorithms to solve core problems that may arise inside applications.

    • Learn key tricks (motifs) underlying the design of new algorithms for emerging applications.

  • Innovate: Create new algorithms for new, previously unseen problems!!

Naturally, the emphasis will be overwhelmingly on learning and application of algorithms. The innovative design of new, previously unknown algorithms is a hard skill to learn (if at all it can be taught in a classroom).

The challenge/fun problems will motivate you to practice thinking through problems to develop problem solving skills and most of all, your confidence in your own skills! We hope to also encourage and support students who wish to participate in online forums such as topcoder, and others to the best of our ability.

Topics Covered

Roughly, we will cover the following topics (some of them may be skipped depending on the time available).

  • Introduction to Algorithms: Complexity analysis.

  • Divide and Conquer Algorithms.

  • Sorting and Order Statistics.

  • Advanced Data Structures: heaps, balanced trees and hash-functions.

  • Dynamic Programming.

  • Greedy Algorithms.

  • Graph Algorithms: Search, Minimum Spanning Trees, Shortest Paths, Network Flows.

  • Introduction to Linear and Integer Programming.

  • Some basic geometric algorithms.

  • Basics of Computational Complexity: P, NP, reductions and open problems.


We will primarily use the textbook by Cormen, Leiserson, Rivest and Stein:


Cormen, Thomas H.; Leiserson, Charles E., Rivest, Ronald L., Stein, Clifford (2009) 1990. Introduction to Algorithms (3rd ed.). MIT Press and McGraw-Hill. ISBN 0-262-03384-4. (Available from CU Bookstore or online booksellers).

Course Work

We will have weekly assignments that will be based on the assigned reading for each class. The class will also involve creating applications using one or more of the algorithms learned. We will expect the students to pick up programming in Python for completing these assignments.

Pre-Lecture Work

Before you attend each lecture, we hope that you will spend 10-15 minutes to prepare:

  1. Read the required portion of the book (at least skim through the book or notes provided).

  2. Watch any videos posted (instructions will be sent via email).

Some lectures may contain a small 5-10 minute tutorial problem that we will solve as a class. After solving the problem, you are expected to submit it to the instructor. The resulting grade will count for your course participation.


We will set up forums that will allow students to interact with the course staff and with each other. You can participate in the forum and help answer questions posed by your classmates. Doing so counts towards your course participation score.

Weekly Assignments

Each problem set will be due in a week from the date assigned. The problem sets will be posted on-line and will be of two types:

  • Online/Moodle Assignment: Simple multiple choice questions that will be autograded. You are allowed multiple attempts at solving these problems. They are intended to help you learn by testing your concepts.

  • Written (Paper and Pencil) Assignment: We will have a few longer, more open ended problems. These have to be solved on paper and turned in at the beginning of the lecture on the due date. Each week the TA will reserve an extra 5 points to students who have turned in a legible assignment that is easy to read. In particular, it is strongly suggested that you consider typing out the assignment in Latex/Word OR you copy out the assignment cleanly from your working sheets before turning in.

Written Assignment Submission and Late Policy

Written paper and pencil assignments have to be submitted on paper during class on the due date (typically fridays). Alternatively, the assignment can be submitted to the course box kept in the CS office/mailroom in Engg. Center 7th floor.

Emailed assignments will not be graded.

Weekly assignments will normally be due on a friday.

  • Assignments turned in before the end of the class noon on friday: full credit.

  • Assignments turned in to course mailbox by Friday evening before 5 PM: 10% penalty.

  • Assignments turned in before 10 AM monday morning: 20% penalty.

To be flexible, we will omit one assignment with the lowest scores from consideration while computing the overall grade.

Programming Assignments

Programming assignments will involve writing simple programs to solve interesting problems using the ideas learned in class. These assignments will be used to crystallize some of the concepts that we will cover in this course. We expect these assignments to be completed in Python.

Programming assignments are compulsory. No extensions will be given and no programming assignment grades will be dropped.


The course will have a quiz every 4 weeks. The dates for the quizzes will be posted well in advance. Each quiz will be 30 minutes long, and will focus on the material corresponding to a set of lectures.

  • The lowest quiz will be dropped for the purposes of computing the grade.

  • It is compulsory to attend the final exam and score at least a 25% to obtain a pass in this course.

Alternative Exams/Accommodations

No alternate exams will be offered unless there is a documented disability or a documented, unforeseen personal or medical emergency.

If you need special accommodations of any nature, you are expected to talk to the instructor during the first 2 weeks of the class. You are also expected to subsequently send in a reminder to the instructor at least one week before each quiz stating the accommodation you require.

Course Participation

Class participation is awarded based mainly on your class preparation, as judged by your general attendance, classroom behavior, interaction in class, willingness to answer questions in class and at the on-line forums, and demonstrating knowledge of weekly reading during problem solving time.


The overall grade will be based on a cumulative score computed by adding together the grades from:

  • The weekly paper and pencil assignments (with least score omitted),

  • The weekly online assignments (with least score omitted),

  • The programming assignments (ideally, we hope to have six to eight such assignments over the semester),

  • The grades from the quizzes (with least score omitted).

  • The final exam (require at least a 25/100 to pass the course).

  • Class participation: you are expected to attend class, and in class you are expected to interact with the instructor.

Overall, the contributions to the final grades will be:

  • Weekly paper and pencil assignments (25% of the grade).

  • Weekly online assignments (10% of the grade).

  • Programming Assignments (15% of the grade).

  • In-Class Quizzes (25% of the grade).

  • Final exam (20% of the grade).

  • Participation (5% of the grade).

The instructor reserves the right to modify this breakup as the semester progresses.

Note: To obtain a passing grade, the student has to appear for the final exam and obtain a score of at least 25/100 or above.

The final grades will be based on the cumulative score from all these factors (out of 100).

Collaboration Policy

The collaboration policy is rather simple:

  • Inspiration is free: you may discuss homework assignments with anyone. You are especially encouraged to discuss solutions with your instructor and your classmates.

  • Plagiarism is forbidden: the assignments that you turn in should be written entirely on your own. While writing the assignment you are not allowed to consult any source other than the textbook(s) for the class, your own class notes or the lecture notes for the class. Copying/consulting from the solution of another classmate constitutes a violation of the course's collaboration policy and the honor code.

  • Do not search for a solution on-line: You may not actively search for a solution to the problem from the internet. This includes posting to newsgroup or asking experts at other universities.

  • When in doubt, ask: If you have doubts about this policy or would like to discuss specific cases, please ask the instructor.

Honor Code

We will expect strict adherence to our our honor code. Please read and understand the code thoroughly. If in doubt, ask the instructor. At the end of the day, honor code violators hurt themselves by sacrificing their integrity and risking hard-earned reputation for a few measly grade points.