in reply to A maybe(?) interesting comp-sci type problem
becomes[A, [B, C]]
In "Higher Order Perl" are some algorithms that do similar things with iterators.[A, B], [A, C]
If you don't have a copy of that book available (which would be a shame, but happens nonetheless ;-)) you should first write a sub that purges any subtrees deeper than 5 (in your example), and then a recursive one that does the expansion.
|
|---|