Advanced data structures

This code accompanies the Algorithms lecture course for computer science at Cambridge University, taught by Damon Wischik.

Contents

Fibonacci heap

The implementation is in fibheap.py. It defines a FibHeap class, which stores hashable objects, and requires a key function (object → priority key).

Disjoint sets

This is the LazyForest implementation of DisjointSet. Most of the code is for pretty-printing!