public static int SumLeafs(BinNode<int> t) { if (t == null) return 0; if (IsLeaf(t)) return t.GetInfo(); return SumLeafs(t.GetLeft()) + SumLeafs(t.GetRight()); }
//Q7a public static bool IsStatic(BinNode<int> tree) { if (tree == null || IsLeaf(tree)) return true; return tree.GetInfo() == SumLeafs(tree.GetLeft()) + SumLeafs(tree.GetRight()); }