Added comments about implementation in each function.

Comments compare my implementation with Cormen’s pseudo-code.