in reply to Re: Looking for Printing all possible combinations
in thread Looking for Printing all possible combinations

Hello choroba, Thank you very much. I highly appreciate. I am trying to understand the code. But I have one question. I have multiple positions with Brackets (for example I have given 3). What do I need to modify so that it works for multiple brackets in File1 and many such strings in file2. I have around 1million entries in File2. Many Thanks.
  • Comment on Re^2: Looking for Printing all possible combinations

Replies are listed 'Best First'.
Re^3: Looking for Printing all possible combinations
by choroba (Cardinal) on Feb 13, 2015 at 13:28 UTC
    The code given here generates exactly the output you requested. Do you understand recursion?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Yes Recursion I understand as a concept. But I am a bit clueless here how to use recursion here?
        It's used here to generate all the possible combinations. The alternate function runs two copies of itself: one with the original char in one position, one with the alternate char. Each copy of the function take the next position and do the same, etc. Did you try running the code on at least a portion of the data?
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^3: Looking for Printing all possible combinations
by sarkar (Initiate) on Feb 13, 2015 at 13:29 UTC
    Like for Example In File 1: I have given string2 T(A)GG(A)GGG(G) But it can have multiple brackets in different strings such as TAA(A)G(T)G(A)GGAG(G)CCA(A) How does it work? What should I modify in the code? And also my File2 is really big with a million Entries.
      Also I have am facing another problem. If there are 3 Brackets I am looking for all possible combinations between the 3. So if i have 4 Brackets I would be looking for all the possible combinations between those 4. If there are "n" Brackets I would be looking for all the possible combinations between the ones ie, "n" in the brackets.