Data structures and algorithms

Reading material and other useful resources

The main course book is our adaptation of the OpenDSA interactive course book.

For doing the labs you will want to look up the library documentations for Java or Python.

Course book content, and optional sections

Here is a quick summary of the chapters in the course book. Everything except where noted is compulsory material!

  1. Introduction
    • motivation, background knowledge, abstract data types, and binary search
  2. Algorithm analysis, part 1: Introduction
    • terminology, growth rates, asymptotic analysis, binary search
  3. Sorting, part 1: Simple algorithms
    • terminology, selection sort, insertion sort
    • optional: 3.4 Bubble sort
  4. Sorting, part 2: Divide-and-conquer algorithms
    • divide-and-conquer algorithms, mergesort, quicksort
  5. Algorithm analysis, part 2: Theory
    • upper and lower bounds, big-O notation and others
    • optional: 5.3.1 Case study: Lower bounds for sorting
  6. Stacks, queues, and lists
    • stacks, queues, linked lists, dynamic arrays, priority queues
    • optional: 6.9 Double-ended queues
  7. Algorithm analysis, part 3: Advanced theory
    • space complexity, amortised analysis, dynamic arrays
    • optional: 7.4 Recurrence relations, 7.5 Multiple parameters
  8. Trees
    • binary trees, general trees, traversing trees
  9. Priority queues and heaps
    • the heap property, binary heaps, heapsort
    • optional: 9.5 Case study: Hoffman coding
  10. Sets and maps
    • sets, maps, multimaps, sorted sets and maps
  11. Search trees
    • binary search trees (BST), self-balancing trees, AVL trees, 2/3-trees
    • optional: 11.4 Splay trees, 11.5 Disjoint sets, union/find, 11.6 Skip lists
  12. Hash tables
    • hash functions, separate chaining, open addressing, algorithmic complexity attacks
    • optional: 12.8 Different probing strategies, 12.11 Bucket hashing
  13. Graphs
    • definitions and properties, implementations, traversing graphs, minimum spanning trees (MST), MST algorithms (Prim’s and Kruskal’s), shortest-path problems, Dijkstra’s shortest-path algorithm
    • optional: 13.10 Specialised algorithms on weighted graphs

Interactive visualisation tools

There are several tools available for visualising how different data structures and algorithms work. Our favourites are of course developed by ourselves :).

Here are some other favourites:

Supplementary material

Data structures is a subject that is taught in a similar way all over the world. This means that there are loads of books about data structures and algorithms. Most of them are okay and present roughly the same material as we do in this course. If you get your hands on a second-hand course book, it’s probably good enough. But be prepared that there might be differences both in how they are organised and what content is included.

We recommend Algorithms (2014) by Robert Sedgewick and Kevin Wayne as supplemental reading, because they have better explanations of the data structures and algorithms. And lots of examples and exercises. It’s enough to only read part 1, which is a very affordable e-book.

The book has an excellent website which is well worth a look. You can find short explanations of each data structure from the book (under the chapter headings on the left of the page), as well a cheatsheet, and references to classic papers.

Free books

Here are some course-related books that are available free online. You do not need to read them to pass the course, but if you want to go deeper then the first book in particular is great!

Non-free but excellent books

The books in this section are not part of the course, but are great reads if you want to learn more. All of them can be found in the Chalmers library.