SelfLearner
Programmer
Hi All,
I'm new here, so forgive me if this has already been posted.
This is not necessarily a PERL question, but more of a logic question. I'm posting it here because ultimately I'll do it in Perl.
We have 3 strings.
$a="me"
$b="you"
$c="him"
The first question is, how do I get these strings to be printed in every possible order?
For 3 strings, the orders are pretty easy to determine:
a-b-c
a-c-b
b-c-a
b-a-c
c-a-b
c-b-a
But what algorithm would you use so the code is not necessarily restricted to 3 variables?
This is really a math question isn't it?!!
Thanks
I'm new here, so forgive me if this has already been posted.
This is not necessarily a PERL question, but more of a logic question. I'm posting it here because ultimately I'll do it in Perl.
We have 3 strings.
$a="me"
$b="you"
$c="him"
The first question is, how do I get these strings to be printed in every possible order?
For 3 strings, the orders are pretty easy to determine:
a-b-c
a-c-b
b-c-a
b-a-c
c-a-b
c-b-a
But what algorithm would you use so the code is not necessarily restricted to 3 variables?
This is really a math question isn't it?!!
Thanks