anagram algorithm
问题 Which is the best way of generating anagrams for a text(maximum 80 characters length). Example: Input: dog output dog dgo odg ogd gdo god I'm only thinking of a backtracking solution, but that will take a while if the text is longer. Another thought is bulding i trie for all words in dictionary, but the problem doesn't ask for real words. Can somebody point out a minimum time complexity solution? Thank you! 回答1: The question looks like generating the list of permutations; (Anagrams are a