You are viewing a single comment's thread. Return to all comments →
I didn't see your comment before and now that you've explained it, I can't believe I didn't find the problem earlier :D
robertram's solution does consider the problem of checking that the children nodes are correct for all parent nodes upto root.
Note that the 'min' and 'max' variables get updated when you call the first two recursions. After you pass root.data to min and max once, all subsequent calls will share the same min and max, not the Integer.XXX_VALUE defined.