explain greedy algorithm in daa