Examples of greedy algorithm