%! no DSC /max2 { dup % a b b 3 2 roll % b b a dup % b b a a 3 1 roll % b a b a lt { exch} if pop } def /btd { /tree exch def /st tree length def /depth st array def /diameter st array def 0 1 st 1 sub { dup depth exch 0 put diameter exch 0 put } for st 1 sub 1 neg 0 { /i exch def tree i get 0 ne { /a i 2 mul 1 add def /b a 1 add def b st lt { depth i depth a get depth b get max2 1 add put diameter i depth a get depth b get add diameter a get diameter b get max2 max2 put } { depth i 1 put } ifelse } if } for diameter 0 get } def [ 1 2 5 3 4 6 7 0 0 0 0 0 0 8 10 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 ] btd =