Write the following recursive methods:
countOdd
to count all the odd numbers in the tree.
min
to find the smallest element in the tree. Hint:
it's a binary search tree, so you know where the smallest element is.
countLeaves
to count all the leaves in the tree.
allOdd
which returns true if all the elements of the
tree are odd and false otherwise.
printDecreasing
to print the tree elements in
decreasing order. Hint: which of the three traversal methods should
you use as a starting point?
Write the following recursive methods:
length
to find the length of the list.
sum
to find the sum of all data in the list.
hasEvenNumberElements
returns true if the list has an
even number of elements and false otherwise. Don't use the length()
method.