add dfs and divide & conquer template