wotuzu17
31-07-2012, 12:25
Hi,
das folgende Problem ist sicherlich in der Informatik wohlbekannt und einfach zu lösen, aber ich krieg es grad nicht hin.
Ich möchte in einem Skript (z.B. mit PHP) alle möglichen Kombinationen von n Variablen ausgeben. Bei 4 Variablen wäre das:
a
b
c
d
ab
ac
ad
bc
bd
cd
abc
abd
acd
bcd
abcd
Es gibt bei
1 2 3 4 .. (Variablen)
1 3 7 15 .. (Kombinationen)
Weiß jemand wie dieses Problem benannt wird, und welcher Algorithmus diese Aufgabe löst?
Danke,
Andreas
das folgende Problem ist sicherlich in der Informatik wohlbekannt und einfach zu lösen, aber ich krieg es grad nicht hin.
Ich möchte in einem Skript (z.B. mit PHP) alle möglichen Kombinationen von n Variablen ausgeben. Bei 4 Variablen wäre das:
a
b
c
d
ab
ac
ad
bc
bd
cd
abc
abd
acd
bcd
abcd
Es gibt bei
1 2 3 4 .. (Variablen)
1 3 7 15 .. (Kombinationen)
Weiß jemand wie dieses Problem benannt wird, und welcher Algorithmus diese Aufgabe löst?
Danke,
Andreas