use Tree.frink /** This contains routines to test the Tree class in Tree.frink. */ /** Create a random tree and insert items into it in a manner that will be binary searchable in order. */ a = toArray[1 to 10].shuffle[] println["Inserting items $a"] tree = undef for elem = a tree = Tree.insertBinary[tree, elem] println["\ndump:\n"] println[tree.dump[]] watcher = new PrintTreeWatcher println["\nInorder traverse:"] tree.inorderTraverse[watcher] println["\npreorder traverse:"] tree.preorderTraverse[watcher] println["\npostorder traverse:"] tree.postorderTraverse[watcher] println["\nbreadth-first traverse:"] tree.breadthFirstTraverse[watcher] println["\ndepth-first traverse:"] tree.depthFirstTraverse[watcher] f= tree.toDotFile[false] w = new Writer["tree1.dot"] w.print[f] w.close[]