This looks like homework, but I'll give you a (one of many, I'd guess)
pseudocode solution:

sub print_combos(str,list) { # note -- PSEUDOCODE
   if (empty(list)) {
      # if (str != "") # do you want the empty list as an output?
      print str;
   } else {
      x = pop list; #remove an element from the local copy of the list
      print_combos(str,list); #send with smaller list and existing str
      print_combos(concat(str,x),list); #add element to str and send
   }
}

                        /\/\ark


-----Original Message-----
From: Yannik Lefebvre [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 12:34 PM
To: [EMAIL PROTECTED]
Subject: How to generate all possible combination from a list of number


Exemple: i have a list of numbers ( 1 - 2 - 3 - 4 -5)

i need to find all possible combination from that list

1
12
123
1234
12345
13
134
1345

etc....

Thank u all!


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to