import drawtree; treeLevelStep = 10mm; treeMinNodeWidth= 1mm; treeNodeStep = 1mm; TreeNode dotNode( TreeNode parent = null ) { frame f; dot( f, (0,0), defaultpen+3); return makeNode( parent, f ); } TreeNode CompleteTree( TreeNode parent= null, int d, int h) { TreeNode me=dotNode(parent); if ( h>1 ) { for( int j=0; j0 ) { CompleteTree(root, d, j ); } } return root; } void FestoonTree( int d, int[] allbranches[], bool outline=false ) { TreeNode[] roots; for( int[] b : allbranches ) { roots.push(FestoonBranch(d, b, outline)); } real x=0; path p=nullpath; for( TreeNode r : roots ) { real width= layout(1,r); p=p--(x+width/2,0); draw(r, (x+width/2,0)); x += width+treeNodeStep; } draw(p); } int[] repeat_integer(int a, int n) { return sequence( new int (int i) { return a; }, n ); } int mod(int a, int b) // computes a mod b with 0<= a mod b < b { return a-b*quotient(a,b) ; } void FestoonTree( int d, int n, bool outline=false ) { int m=(d-1)*n+1; int k=0; int[][] alltrees; while( m > 0 ) { int r=mod(d-1-m,d); int a=(d-1)*(1+(d+1)*r); int[] trees; if ( a