General Info


Materials "Introduction to Algorithms", 3rd edition (CLRS), Cormen, Leierson, Rivest, and Stein + notes.

CodeJudge We use CodeJudge for testing code and correcting the implementation part of the mandatory exercise. Access CodeJudge at XXX.

Gradescope We use Gradescope for correcting the written part of the mandatory exercise and the final exam. The system significantly improves consistency and quality in grading. Please sign up for Gradescope as follows:

  1. Go to
  2. Select "Sign up for free".
  3. Select "Sign up as a student".
  4. Enter the course entry code 4PGYJ4, your full name, your email, and your student-id (of the form s123456). Please follow these instructions precisely so that we can correctly identify you.
If you do not wish to sign up for Gradescope please contact the course responsible.


The weekplan is preliminary and may be updated during the course.

Week Topics Slides Weekplan Material Algorithm Demos Programming Demos
Warmup: Preparation, Programming Prerequisites, and Puzzles. Warmup Survival Guide · Programming Prerequisites Factorial function
Basic Concepts I: Introduction, Algorithms, Data Structures, Peaks. 1x1 · 4x1 Introduction CLRS chap. 1 Recursive Peak Algorithm Peaks
Basic Concepts II: Searching, Sorting. 1x1 · 4x1 Searching and Sorting CLRS chap. 2 Binary Search · Insertion Sort · Merge · Mergesort Binary Search
Basic Concepts III: Complexity, Asymptotic Notation, Empirical Analysis. 1x1 · 4x1 Analysis of Algorithms CLRS chap. 3
Data Structures I: Stack, Queues, Linked Lists, Trees. 1x1 · 4x1 Introduction to Data Structures CLRS intro to part III + chap. 10 Stack with Array · Queue with Array · Dynamic Array 1 · Dynamic Array 2 Linked List
Graph Algorithms I: Undirected Graphs, Representation, Searching, Modelling. 1x1 · 4x1 Introduction to Graphs CLRS intro to part VI + chap. 22.1-22.4 + appendix B.4-B.5. DFS · BFS DFS
Graph Algorithms II: Directed Graph, Topological Sorting, Implicit Graphs. 1x1 · 4x1 Directed Graphs CLRS intro to part VI + chap. 22.1-22.4 + appendix B.4-B.5. Topological Sort Topological Sort
Data Structures II: Priority Queues, Heaps. 1x1 · 4x1 Priority Queues and Heaps CLRS chap. 6 + appendix B.5 Bubble up and down Heap
Data Structures III: Union-Find, Dynamic Connected Components. 1x1 · 4x1 Union-Find CLRS chap. 21 except 21.4 + Algorithms, 4ed. chap. 1.5 Quick Union · Weighted Quick Union
Graph Algorithms III: Minimum Spanning Trees, Prims' Algorithm, Kruskal's Algorithm. 1x1 · 4x1 Minimum Spanning Trees CLRS chap. 23. Prims' Algorithm · Kruskal's Algorithm
Graph Algorithms IV: Dijkstra's Algorithm, Shortest Paths in Weighted Graphs, Shortest Paths in DAGs. 1x1 · 4x1 Shortests Paths CLRS chap. 24 except 24.1 and 24.4. Dijkstras' Algorithm
Data Structures IV: Dictionaries, Hashing. 1x1 · 4x1 Hashing CLRS chap. 11 except 11.5. Chained Hashing · Linear Probing
Data Structures V: Algorithms on Trees, Predecessor Problem, Binary Search Trees. 1x1 · 4x1 Binary Search Trees CLRS chap. 12 except 12.4. Binary Search Trees
Course Wrap-Up: Questions, Selected Exercises from an Old Exam, Advanced Courses in Algorithms.

Mandatory Exercise

The course has a single mandatory exercise. The mandatory exercise is done in small groups.

Collaboration policy The mandatory exercise is subject to the following collaboration policy. The exercise should be done in groups of 2 or 1 (i.e., in pairs or individually). It is not allowed to collaborate with other groups on the exercises, except for discussing the text of the exercise with teachers and fellow students enrolled on the course in the same semester. Under no circumstances is it allowed to exchange, hand-over or in any other way communicate solutions or parts of solutions to the exercises to other groups. It is not allowed to use solutions from previous years, solutions from similar courses, or solutions found on the internet or elsewhere.

Frequently Asked Questions

What programming and mathematics requirements do I need for the course? In general, you need an introductory course in programming and mathematics. We use basic programming extensively to implement algorithms and discrete mathematics to analyse algorithms. See the materials on this page to clarify how this applies to your current competencies in programming and mathematics.

What is the language of the course? The official language of the course is English. Hence the spoken language in lectures and the exam is in English. There are Danish exercise classes and your are free to hand in the mandatory exercise and the exam in Danish.

What is the programming language used in the course? You can use most standard imperative programming languages (including Python, Java, C, and C++). The language must be supported by CodeJudge.

I need to quickly refresh my programming skills. What do you recommend? We suggest the book "Introduction to Programming in Java", Sedgewick and Wayne. The book is compact, concise, and focused on the core technical aspects of programming. The books covers essentially all relevant material for the course in chapter 1, which is freely available at the homepage for the book.

Which supplementary books/materials do you recommend? We suggest the following:

When and where is the exam? Please see the DTU exam schedule.