Kotlinlearncs.online LogoJava
Return to List

Solve: Binary Tree Sum Right Child

Created By: Pranav Narayanan
/ Version: 2025.2.0

Write a method named sumRightChild. sumRightChild accepts a single BinaryTree<Int> and returns the sum of the values in every node that is a right child. You may need to write a private helper method to solve this problem.

For reference, cs125.trees.BinaryTree is defined like this:

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/solve/kotlin/binary-tree-sum-right-child/[email protected]