Click to See Complete Forum and Search --> : permutation / combination problem VB.NET PLEASE HELP!


vfranklin
September 24th, 2004, 02:36 AM
I have an array that looks somthing like this:
1, a
2, b
3, c
3, 6
4, e
5, f
5, g

the first column represents the sequence possibilities of the second column of digits. I need an algorithm that gives me ALL the number/letter variations (combinations) based upon that structure. In the example above we have a total of 4 number/letter combination possibilites:

abcef
ab6ef
abceg
ab6eg

The digits cannot move out of thier sequences but do to the variations within a sequence position I'm having difficulty coming up with an inclusive script ... I'm sure recursion will be involved. PLEASE HELP!! Thanks ahead of time. The length of this array can be 1 to n and the number of digits that a sequence may have is also 1 to n.

thanks again.

mehdi62b
September 25th, 2004, 03:50 PM
Take a look at this

http://www.codeguru.com/forum/showthread.php?t=301647
it just could show a way(not solving your homework)