Let us construct the below tree 5 / \ 4 5 / \ \ 4 4 5
root = new Node ( 5 ) ; root . left = new Node ( 4 ) ; root . right = new Node ( 5 ) ; root . left . left = new Node ( 4 ) ; root . left . right = new Node ( 4 ) ; root . right . right = new Node ( 5 ) ; document . write ( " " + countSingle ( root ) ) ;