CS 528 Advanced Data Structures and Algorithms

Fall 2015

Meeting Times

Lect: 12:00 - 12:50 M, Tu, Wed,  HB 112

Lab: 12:00 – 12:50 Th, HB 204


Dr. Razvan Andonie, HB 214-E, Office hours


Joseph Lemley,


Introduction to Algorithms, 3 rd Edition, by Thomas Cormen, Charles Leiserson, Ronald Rivest, and Clifford Stein.

A Primer on Scientific Programming with Python, 4th Edition, by Hans Petter Langtangen, Springer, 2014.



This course is a continuation of previous undergraduate classes (programming, data structures, and algorithms) and has the role of reviewing but also introducing more advanced topics. As a first computer science course in the Computational Science Master’s Program, it will bring students which may come with different computational background to the same basic level. It focuses on the understanding and design of fundamental algorithms, with a more thorough presentation of time and space complexity.



Growth of functions: asymptotic notation.

Divide-and conquer: the maximum-subarray problem, Strassen’s algorithm for matrix multiplication, solving recurrences, the master theorem for solving recurrences.

Probabilistic analysis and randomized algorithms.

Sorting and order statistics: heapsort, quicksort, sorting in linear time, median and order statistics

Data structures: stacks, queues, linked lists, hash tables, binary search trees, red-black trees, augmented data structures.

Dynamic programming: matrix-chain multiplication, longest common subsequence, optimal binary search trees.

Greedy algorithms: Huffman codes, matroids and greedy methods, task-scheduling as a matroid.






Final project


Grade Distribution:

95 - 100   A

90 - 94     A-

87 - 89     B+

83 - 86     B

80 - 82     B-

77 - 79     C+

73 - 76     C

70 - 72     C-

67 - 69     D+

63 - 66     D

60 - 62     D-

0  - 59      F


If you must miss an exam, contact your instructor prior to the exam to schedule a time to make it up. Late submission of assignments is generally not accepted. No partial credit for late assignments will be offered.

Lecture Resources

Some excellent video lectures following this textbook are available from MIT's Open Courseware, along with assignments, readings, solutions, and so forth. The same videos are also available for download through iTunes University in iPod/iPhone-ready formats. MIT OpenCourseWare (MIT OCW) is an initiative of the Massachusetts Institute of Technology (MIT) to put all of the educational materials from its undergraduate- and graduate-level courses online. The lectures of many courses are available in video format, freely downloadable.


Very interesting are also the MIT Open Courseware on the mathematics of computational science. We are not going to focus on these topics, since they will be subject of other courses.

Laboratory & Software

The Laboratory serves as a first introduction to computer programming of scientific applications, using the high-level Python language. The applications are taken from mathematics, numerical calculus, statistics, physics, biology, and finance. By blending programming, mathematics and scientific applications, the laboratory projects lay a solid foundation for practicing computational science.


We use Python. To install Python, use the WinPython installation package. Use the included Spyder scientific development environment. You may install the 32 or 64 bit version, but it is better to install Python 2 (not 3). This software is available in the lab. Scientific computing with Python still goes mostly with version 2. A widely used strategy for software developers who want to write Python code that works with both versions, is to develop for version 2.7, which is very close to what is found version 3.4, and then use the translation tool 2to3 to automatically translate from Python 2 to Python 3. A good link for scientific programming in Python is Numeric & Scientific Computation with Python. Here are some excellent Python Scientific lecture notes.

Other Python Resources: Python high-performance container datatypes, Problem Solving with Algorithms and Data Structures using Python, Theano

Final Project

The Final Project should be submitted as a technical report and presented in class. It will be graded as follows: 1/3 Python code, 1/3document, and 1/3 presentation. The report document should contain: problem description, benchmarking, figures, and discussion. Tables and a list of references are a plus. Using LaTeX brings an extra-credit of 10% to the project’s grade. Guidelines can be found at here. The presentation should be made with 10-15 slides, in about 15 minutes, including questions and answers. Presentation guidelines can be found here. Submit the report, source code and slides by email.

Course Schedule




Textbook: Leiserson







Getting started: analyzing algorithms, insertion sort, mergesort

Ch. 1 & 2

Video Lecture 1

Ex. 2.1-3, 2.3-2, 2.3-3, 2.3-4, 2.3-5, due next class

(not graded)


Correctness of algorithms. correctness of insertion sort and bubble sort

Ch. 2


Growth of functions

Ch. 3

Video Lecture 2

Ex. 3.1-4, 3.1-5, 3-3, due next class

(not graded)


Growth of functions, divide and conquer

Ch. 3 & 4



Divide and conquer

Ch. 4

Video Lecture  3

Ex. 4.1-2, 4.1-5, 4.2-7, due next class

Ex. 4.1-3, due next Lab.

(not graded)


Divide and conquer

Ch. 4



Mathematical analysis of recursive algorithms

Solving Recurrence Equations review (on Neve)

Homework 1 (on Neve), due next class

(not graded)


Mathematical analysis of recursive algorithms



Mathematical analysis of recursive algorithms




Randomized algorithms

Ch. 5 (5.1 – 5.3)

Video Lecture 4



Probabilistic analysis and of randomized algorithms: indicator random variables

Ch. 5 (5.1 – 5.3)

Ex. 5.2-5, due next class

(not graded)



Ch. 6



Test (not graded)







Linear-time sorting: lower bounds, counting sort, Radix sort

Ch. 8

Video Lecture 5

Problem 3-4 (a – f), due next class



Linear-time Sorting: Bucket sort

Ch. 8

Problem 4-1 (a – g), due next class



Order statistics, median

Ch. 9

Video Lecture 6



Elementary data structures

Ch. 10




Ch. 11 (11.1 – 11.3)

Video Lecture 7




Ch. 11 (11.4 – 11.5)

Video Lecture 8



Veterans Day




Binary search trees

Ch. 12

Video Lecture 9



Dynamic programming: matrix-chain multiplication, elements of dynamic programming

Ch. 15 (15.1 – 15.3)

Video Lecture 15

Ex. 15.2-1, due next class



Dynamic programming: longest common subsequence, edit distance, Viterbi algorithm

Ch. 15 (15.4)

Ex. 15.3-6, Problems 15-5, 15-7 & 15-10 discussed in class

Ex. 15.3-6


Greedy algorithms: elements of greedy strategy, the activity-selection problem, Huffman codes

Ch. 16 (16. 1 – 16.3)

Video Lecture 16



Greedy algorithms: matroids, task-scheduling

Ch. 16 (16.4 – 16.5)







Amortized analysis

Ch. 17

Problems 17-3, 17-4 & 17-5 discussed in class

Video Lecture 13 & Video Lecture 14



Data structures for disjoint sets

Ch. 21 (21.1 – 21.3)



Final Project presentations


Final Project due

Laboratory Schedule




Textbook: Langtangen



Introduction to Python

Introduce Project 0 (not graded): Exercises 1.1 – 1.4

Ch. 1-2

Resources for "A Primer on Scientific Programming with Python”



Introduce Project 1 (graded): Exercises 2.20, , 3.13, 3.15, 3.18

Ch. 3-4

Project 0 due


Introduce Project 2 (graded): Exercises 5.31 & 5.38.

Ch. 5

Project 1 due


Project 2




Introduce Project 3 (graded): Exercises 8.18 & 8.24.

Ch. 8

Project 2 due


Project 3




Introduce Project 4 (graded): Exercises A.16 & A.24.

Appendix A

Project 3 due


Introduce Final Project (graded). Choose one of the following exercises: 8.36 or 8.40.


Project 4 due


Final Project





No classes

No classes


Final Project presentations


Final Project due


Honor Code: All work turned in for credit, including exams and all components of the project, are to be the work of the student whose name is on the exam or project. For all project components, the student can receive assistance from individuals other than the instructor only to ascertain the cause of errors. Thus you can get help if you need it to figure out why something doesn't work. You just can't get help from anyone, other than the instructor or TA, to figure out how to make something work. All solutions turned in for credit are to be your individual work and should demonstrate your problem solving skills, not someone else's. Help each other understand and debug the programming assignments. However, you should write the code for your programs yourself. Writing it yourself is the only way you will learn. Since everyone is writing their own code, no two programs should be the same or so similar that I could convert one to the other by a simple mechanical transformation (e.g. changing variable names and comments). I consider this plagiarism and a violation of academic code. The following text should appear on all assignments: “I pledge that I have neither given nor received help from anyone other than the instructor for all program components included here.

First violation: Students must meet with the instructor. In most cases, the grade will be split between the authors of the copied programs. Second violation: Students will receive no credit for the assignment, an incident letter will be placed on file in the Computer Science Department, and the matter referred to the Computer Science Department Chair.

Class Attendance: Class attendance is expected and recorded.

ADA Statement: Students with disabilities who wish to set up academic adjustment in this class should give me a copy of their "Confirmation of Eligibility for Academic Adjustment" from the Disability Support Services Office as soon as possible so we can discuss how the approved adjustment will be implemented in this class. Students without this form should contact the Disability Support Services Office, Buillon 205 or or 963-2171.

Caveat: The schedule and procedures for this course are subject to change. It is the student's responsibility to learn of and adjust to changes.