Data structures and algorithms

Reading material and other useful resources

The main course book is our adaptation of the OpenDSA interactive course book. A pre-print version of the book will be sold at the lectures.

There are some very nice visualisations of data structures and algorithms that you should have a look at.

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. The sections ending with an asterisk (*) are optional – everything else is compulsory material (except where noted below)!

  1. Introduction
    • motivation, background knowledge, abstract data types, and binary search
  2. Sorting, part 1
    • terminology, selection sort, insertion sort
  3. Algorithm analysis, part 1
    • terminology, growth rates, asymptotic analysis, binary search
  4. Sorting, part 2
    • divide-and-conquer algorithms, mergesort, quicksort
  5. Algorithm analysis, part 2
    • upper and lower bounds, big-O notation and others
  6. Sequences
    • stacks, queues, linked lists, dynamic arrays
  7. Algorithm analysis, part 3
    • space complexity, amortised analysis, dynamic arrays
  8. Abstract data types
    • sequences, priority queues, sets and maps, sorted sets and maps
    • naive implementations for all the ADTs
  9. Trees and heaps
    • binary trees, traversing trees, other kinds of trees
    • heaps, the heap property, binary heaps, meldable heaps
  10. Search trees
    • binary search trees (BST), self-balancing trees, AVL trees, 2/3-trees, B-trees
  11. Hash tables
    • hash functions, separate chaining, open addressing, linear probing, algorithmic complexity attacks
  12. Graphs
    • definitions and properties, representing graphs, traversing graphs, shortest-path problems, Dijkstra’s shortest-path algorithm, minimum spanning trees (MST), MST algorithms (Prim’s and Kruskal’s)

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, they have good explanations of the data structures and algorithms. And lots of examples and exercises. The book website is well worth a look even if you don’t buy the book. 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.