Function to perform tree pruning by performing post order traversal
function treePruning ( root , result ) { if ( root == null ) return null ; root . left = treePruning ( root . left , result ) ; root . right = treePruning ( root . right , result ) ;