Given n sets of choices: (1,2,3), (2,3,4), (4,5) You pick one element from each set of choices. Generate all possible picking.
You don't need depth-first or breadth-first.
why recursion? The following gives all possible pickings in list. A=[1,2,3]; B= [2,3,4], C=[4,5] list= for a in A: for b in B: for c in C: list.append([a,b,c])
Dec 25, 2011