# testbst.dat # for testing CS 20 assignment 3, part 2, Summer 2009 # insert root and 2 children insert dog insert cat insert fox print pre # show some stats, and tree orders count depth cat height # insert 5 on the right, and 5 on the left insert mule insert giraffe insert kangaroo insert elephant insert catfish insert apple insert bear insert banana insert acorn # check stats and orders again count height depth bear print pre print in print post # delete a right and a left leaf delete catfish delete elephant # verify deletion, then put them back and verify that print in insert elephant insert catfish print in # delete a node that has two children delete cat # show some more stats (bear should be where cat was) count depth bear height print pre print in print post # delete nodes with just left or right children delete giraffe print in delete mule print in # find some things in the tree contains apple contains catfish contains bear contains dog contains kangaroo contains banana # try to insert some things already in the tree insert apple insert dog insert kangaroo # try contains/depth/delete of stuff already deleted from tree contains cat depth giraffe delete mule # clear and try some empty tree things clear count height print pre print in print post contains dog depth dog delete dog # some error cases (for the sake of completeness) # bad command weight # incomplete commands contains depth delete insert print # done