the method receives a root node of a binary tree and should return the sum of all node's items that are bigger than the number n (I did it with double, but it can be ints just the same) static double sumOfBiggerThan(TreeNode node, double n) { if (node == null) return 0; double temp = 0; if (node.item > n) temp = n; temp += sumOfBiggerThan(node.left, n); temp += sumOfBiggerThan(node.right, n); return temp; }