add greedy algorithm and dynamic programing