Unformatted text preview: would be unacceptable. 2. Write a Java method treeprint(node t, int n) that will print a tree in indented form, using a preorder traversal. The argument n is the current depth in the tree, whose value at the beginning of the recursion is assumed to be zero. Example: a (3) ... b (1) ... . .. c(0) ... d (2) ... . .. e (0) ... . .. f (0) ... g (0) In this tree, a has 3 children (b,d,g), b has one child (c), and d has 2 children (e and f)....
View
Full Document
 Fall '08
 Davis
 Algorithms, Data Structures, complete binary tree, real number xv

Click to edit the document details