Function to perform every possible split and calculate absolute difference of subtrees
preOrder ( root , minDiff ) ; return minDiff [ 0 ] ; } function postOrder ( root ) { if ( root == null ) return 0 ; root . val += postOrder ( root . left ) + postOrder ( root . right ) ; return root . val ; } function preOrder ( root , minDiff ) { if ( root == null ) return ;