using Symata; isymata()
C
is a tree:
C = [a,[[a1,[a12,b12,c12]],[b2,[a22,b22,c22]],[c3,[a32,b32,c32,d32]]]];
begin
trav(tree_List) := Flatten(trav([], tree), 1)
trav(accum_List, [x_, y_List]) := Map(yy -> trav([accum, x], yy), y)
trav(x_,y_) := Flatten([x,y])
end
trav(C)
This example is from L. Shifrin, and is found at http://mathematica.stackexchange.com/questions/5753/determining-all-possible-traversals-of-a-tree/5756#5756