anagram

17 views
Skip to first unread message

aziz

unread,
Apr 30, 2020, 7:08:50 AM4/30/20
to Racket Users
hello i need again your help i have an examen in one day i need to understand this programme : Define an anagr function taking as a parameter a character string and returning the list of all anagrams of this string. We are not concerned in this question of whether an anagram appears several times or not in the result. We can do this in the following way: calculate all anagrams starting with the first character of the given string, then all those starting with the second character of the given string and so on. For example, this function could give the results following: (anagr "abc") returns' ("abc" "acb" "bac" "bca" "cab" "cba") and (anagr "aba") returns ("aba" "aab" "baa" "baa "" aab "" aba "). i have an idea : isolated the first character then calculate the anagrams of the remaining strings then with the second character and so on
But i don't know how make this exercise please
Reply all
Reply to author
Forward
0 new messages