Hello. I need to write a program which can do permutations. E.g cat cta act atc tca tac will be printed out if the imput cat is given on the command line. Similarly, 24 different combinations should be printed out if a String with 4 characters are given. The code I written is shown below:
The result I got missed first few characters for each combination. Could anyone help me to fix it? If you think my idea is totally wrong, please give me some hints, please.
Herb Schildt
Author
Ranch Hand
Joined: Oct 01, 2003
Posts: 239
posted
0
I tried compiling the code that you posted but got a number of compiler errors. Could repost a clean copy of your program?
For my latest books on Java, including my Java Programming Cookbook, see HerbSchildt.com
I couldn't get this code to compile without a few changes. even then, it wouldn't run - getting a "java.lang.NoClassDefFoundError: Permutations" error. are you sure the code you posted was correct? sorry for the duplicate post, i was typing mine when Herb posted his. [ October 08, 2003: Message edited by: fred rosenberger ]
Never ascribe to malice that which can be adequately explained by stupidity.
Lin Shen
Ranch Hand
Joined: Oct 08, 2003
Posts: 57
posted
0
Lin Shen
Ranch Hand
Joined: Oct 08, 2003
Posts: 57
posted
0
Sorry. The copy/paste does not work. I therefore typed my code by hand. Here is the code again.