Binary Tree Sum

In this post we will develop a couple methods to collect some information from a binary tree. The first method will be the base, and the second will be an enhancement of the first.

The first requirement is:  given a binary tree with double values, compute the sum of all nodes in the tree.

The second requirement is:  given a binary tree with double values, compute the sum of all nodes whose values are in a specified range (e.g., [ 10.0 : 15.0 ]). Continue reading “Binary Tree Sum”