7.7.4. Binary Tree Check Sum Exercise
https://opendsa-server.cs.vt.edu/ODSA/Books/CS3/html/BinaryTreeInfFlw.html#binary-tree-check-sum-exercise
X286: Binary Tree Check Sum Exercise
Given a binary tree, check if the tree satisfies the property that for each node, the sum of the values of its left and right children are equal to the node's value. If a node has only one child, then the node should have the same value as that child. Leaf nodes automatically satisfy the property.
Here are methods that you can use on the
interface BinNode {
public int value();
public void setValue(int v);
public BinNode left();
public BinNode right();
public boolean isLeaf();
}
---
Here are methods that you can use on the
BinNode objects:interface BinNode {
public int value();
public void setValue(int v);
public BinNode left();
public BinNode right();
public boolean isLeaf();
}