DP or DFS