NPRG062 Introduction to Algorithms (winter 2020-21)

Instructor: Adam Dingle

This course is a fast-paced introduction to fundamental algorithms, algorithmic complexity, and data structures,.

Lectures and other meetings

For at least the month of October, all lectures and tutorials will take place on Zoom.

Requirements

This course includes both a pass/fail credit and a graded final exam.

To receive the credit, you must fulfill the following requirements:

You must complete the credit before you can enroll for the exam. The final exam includes both a written part and an oral part. The grade for the exam is based on both parts.

Textbooks

The Miller text is available online (see the link above). There are many copies of the Cormen text in the MFF library on the first floor.

Syllabus

This is a rough map of the ground we plan to cover in this class.

To access any of the videos below, use our Zoom meeting ID and passcode (not your CAS login) as the username/password.

September 30 (lecture video) (notes) (exercises)
Course overview. Mathematical terminology. Powers of two and ten. Logarithms. Divisibility. Quotient and remainder. Converting to hours, minutes and seconds.
October 7 (lecture video) (notes) (exercises)
Decimal representation. Splitting an integer into digits. Joining digits to form an integer. Numbers in different bases. Converting between bases. Prime numbers. Primality testing using trial division.
October 14 (lecture video) (notes) (exercises)
The fundamental theorem of arithmetic. Prime factorization. Limits. Big-O notation. Analyzing a program's running time. Worst-case and best-case analysis. Greatest common divisor. Euclid's algorithm. Least common multiple.
October 21 (lecture video) (notes) (exercises)
The sieve of Eratosthenes. Sequential search in an array. Binary search for values.
October 28 (review sesson video)
No lecture (Czechoslovak Independence Day)
November 4 (lecture video) (notes) (exercises)
Binary search for a boundary. Bubble sort, selection sort, insertion sort. Merging sorted arrays. Mergesort.
November 11 (lecture video) (notes) (exercises)
Quicksort. Linked lists.
November 18 (lecture video) (notes) (exercises)
Abstract data types. Stacks. Queues. Binary trees.
November 25 (lecture video) (notes) (exercises)
Sets. Binary search trees. Balanced and imbalanced trees. Hash functions.
December 2 (lecture video) (notes) (exercises)
Dictionaries (maps). Hash tables. Priority queues. Heaps.
December 9 (lecture video) (notes) (exercises)
Heapsort. Graph representations.
December 16 (lecture video) (notes) (exercises)
Depth-first search. Breadth-first search.
December 23, 30
No lecture (winter vacation).
January 6 (lecture video) (notes) (exercises)
Searching in a state space. Infix, prefix and postfix notations. Expression trees. Parsing arithmetic expressions.