Implementation of theory from CLRS (Introduction to Algorithms, 3rd ed.)