Implementation of algorithms from CLRS Book