graph & tree, dp, dfs