dfs, km, trie