Helper function that allocates a new node with the given data and null left and right pointers .
function newNode ( data ) { let node = new Node ( ) ; node . data = data ; node . left = node . right = null ; return ( node ) ; }