Little exercises in fundamental algorithms