Helper function that allocates a new node with the given key and null left and right pointers .
static node newNode ( int key ) { node node = new node ( ) ; node . key = key ; node . left = null ; node . right = null ;