Create a method named negativeSum
that accepts a BinaryTree<Int>?
,
that is a nullable BinaryTree
containing Int
values.
Return the sum of all the negative values in the tree.
For reference, cs125.trees.BinaryTree
is defined like this:
Stuck? You may find these lessons helpful: