Kotlinlearncs.online LogoJava
Return to List

Homework: BinaryTree Negative Sum

Created By: Geoffrey Challen
/ Version: 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:

Related Lessons

Stuck? You may find these lessons helpful: