The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Recursion

Posted by Louis Miguel on March 09, 2001 at 2:40 PM

May I know how to construct a recursive solution to this?

Say I need to output different combinations of strings.
For example, given the following input:

BIG
DOG
CAT
MAN
3 // this value indicates the number of strings
// above per combination

then i should get something like:

BIGCATDOG
BIGCATMAN
BIGDOGCAT
BIGDOGMAN
CAT...
...
...etc..

The output is also in alphabetical order....




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us