Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site eosp1.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!astrovax!fisher!eosp1!wsl From: wsl@eosp1.UUCP (Warren Lobel) Newsgroups: net.lang.c Subject: Need C Algorithm Message-ID: <1289@eosp1.UUCP> Date: Wed, 12-Dec-84 14:59:58 EST Article-I.D.: eosp1.1289 Posted: Wed Dec 12 14:59:58 1984 Date-Received: Fri, 14-Dec-84 04:02:00 EST Distribution: net.unix-wizards,net.unix,net.lang,net.puzzle Organization: Exxon Office Systems, Princeton, NJ Lines: 24 My friends and I have come across an interesting coding problem. We are trying to write a program that given a string of digits (or letters) of length N will generate all N factorial permutations of those digits. For example: For the word 'cat' the program will generate the following: cat cta act atc tca tac The ordering is arbitrary and should be dependent on the algorithm used. At first this seems to be a rather trivial task, however, it is much more difficult then it appears to be initially. I would appreciate any help in writing this algorithm, preferrably in 'C' but any language (though I suspect a language that can handle recursion is best) will do. Please mail me the solution or at least which newsgroup it is posted in. Thanks a lot Warren S. Lobel Exxon Office Systems Princeton, NJ