Home
>
Sets
>
tree-invert
>
Full Page
|
Comparative Timings
Tree Invert
William's Challenge 2 : inverting the nodes in a tree with a max of one child per node ie. a "stick"
1.
Invert via a sequence of names by Chris Wallace
functions to convert between a seq of names and a stick, + reverse()
2.
recursive function by Chris Wallace
find the leaf node and build the inverted stick in reverse
3.
recursive function by William Candillion