Once upon a time we
discussed the possibility of a new forum to post little programming challenges of varying difficulty and the like, just to get people to think a little bit about algorithms and such, and to stretch their brain. It doesn't look like that forum's going to happen (too bad, I hear Mark Herschberg has a ton of these), but I thought I would begin posting a few every now and then just to see how it goes.
Anyway, here's a little programming challenge for people to play around with.
The Challenge
-------------
Given any
string (you might have to set a character limit though or you'll probably run out of memory), write a small program that displays all the anagrams for that string.
That is if my input string is "abc" my output should be:
abc
acb
bac
bca
cab
cba
There are no "correct" answers
per se, assuming the output is correct, so I won't be posting what the "right" way to do it is (even if I did know
). It's just an exercise to see how different people come up with a way to solve a problem and maybe we'll have some resulting discussion about maybe what some "best" ways are to solve the problem. When you post your code, be sure to use the UBB CODE tags.
Have fun.
[ September 12, 2002: Message edited by: Jason Menard ]