BinaryTree Negative Sum
Geoffrey Challen // 2021.10.0
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: