Create a method named oddSum
that accepts a BinaryTree<Int>?
,
that is a BinaryTree
containing Int
values.
Return the sum of all the odd values in the tree.
As a reminder, value % 2
returns a non-zero value if value
is odd.
For reference, cs125.trees.BinaryTree
is defined like this:
Stuck? You may find these lessons helpful: