beyondgrader.com Logo
DemoBrowseAboutTeamLogin

BinaryTree Odd Sum

Geoffrey Challen // 2021.4.0

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: