what does it mean for an algorithm to be greedy code example Example: greedy algorithm greedy algorithm: makes the optimal choice at each step