Official Asymptote example – binarytreetest

Category: Asymptote,Official Gallery One-PagerPh. Ivaldi @ 10 h 57 min

Figure 0015
(Compiled with Asymptote version 2.14svn-r5318)
/* This code comes from The Official Asymptote Gallery */
    
import binarytree;

picture pic,pic2;

binarytree bt=binarytree(1,2,4,nil,5,nil,nil,0,nil,nil,3,6,nil,nil,7);
draw(pic,bt);

binarytree st=searchtree(10,5,2,1,3,4,7,6,8,9,15,13,12,11,14,17,16,18,19);
draw(pic2,st,blue);

add(pic.fit(),(0,0),10N);
add(pic2.fit(),(0,0),10S);


Étiquettes : ,