explain greedy algorithm in data structure