Knuth's power tree: Difference between revisions

Content added Content deleted
m (J: bugfix (posted version of code didn't handle 0 exponents properly))
m (J: need to show tree generation...)
Line 108: Line 108:
Task examples:
Task examples:


<lang J> kpt 191 NB. generate sufficiently large tree
<lang J> findpath 0
0 1 1 2 2 3 3 5 4 6 5 9 6 10 7 9 8 16 9 14 10 14 11 13 12 17 13 18 14 25 15 22 16 17 17 21 18 33 19 26 20 25 21 40 22 27 23 42 24 33 25 34 26 31 27 44 28 38 29 46 30 56 31 42 32 64 33 50 34 46 35 57 36 65 37 50 38 55 39 69 40 54 41 43 42 51 43 58 44 47 45 ...
findpath 0
0
0
2 usepath 0
2 usepath 0