Write a recursive private method calledcountTwoEvenChildsto be included in classBinaryTree as discussed in the lectures. The method counts and returns the number of nodes having two children with even data values in the binary tree.
This method is called from a public methodcountTwoEvenChildsBT, given as follows:
public int countTwoEvenChildsBT(){
return countTwoEvenChilds(root);
}
Method heading:
private int countTwoEvenChilds(Node node)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here