Add dynamicprogramming and greedy algorithm