String Combination Algorithims

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EpicOfChaos
    New Member
    • Jun 2007
    • 15

    #1

    String Combination Algorithims

    Hey guys,
    Anyone have any code, or psuedo code that would make the following scenerieo?
    Strings A, B, C

    Create as many combinations of the 3 strings
    so long as the length of the entire new string is less than MAXLENGTH.
    Example:

    String A="a" B = "ab" C="ba";
    combinations
    a
    aa
    aaa
    ab
    aba
    abba
    . . .
    Any ideas guys?
  • aboolamoola
    New Member
    • Jan 2008
    • 5

    #2
    i c ur problem, well i think the best way to solve ur problem is to make some loops, like a nested loop.

    for (int i = 0; i < letter.length; i ++){
    for (int j = 0; j < letter2.length; j ++){
    .......
    .......
    }
    }

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      Originally posted by aboolamoola
      i c ur problem,
      Please spell out words: "I see your..."

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Originally posted by BigDaddyLH
        Please spell out words: "I see your..."
        aboolamoola,

        In case you didn't notice, that is a warning from a moderator. Lets learn the rules of posting in this forum before we go and get ourselves another warning, mkay?

        Click on this link: http://www.thescripts.com/forum/faq....ing_guidelines

        P.S. [CODE=java]if (numWarning > x)
        {
        switch (userID)
        {
        case aboolamoola:
        account += ban;
        break;
        }
        }
        [/CODE]

        -MODERATOR

        Comment

        • EpicOfChaos
          New Member
          • Jun 2007
          • 15

          #5
          I think I know what you are saying, but still not really understanding, I know that the number of combinations is 59.

          Comment

          Working...