Simple anagram algorithm?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need an algorithm to create all possible anagrams from a given word. It
should be quite straight-foreward, but I can't seem to get my head around
it... :-(
- any suggestions?

Thanx in advance,
Pryce
 
Not sure what you want, exactly. If you seek all permutations of a list of
letters, you can find suggestions at
http://www.frontiernet.net/~fredm/dps/Contents.htm , including a C# library
that contains the permutation algorithm. The same library will let you form
all combinations of letters, given a list of letters. Between the two
methods, you could get all 1,2,3,.... -letter possible words, given a list
of letters.

If you want to look the resulting (possible) words up in a dictionary, you
can use the ENABLE dictionary; download it at
http://personal.riverusers.com/~thegrendel/software.html
 
looks like homework.

Hopefully, we haven't spoiled your learning by giving away too many of the
answers.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Back
Top