greedy algorithms notes