Structure of a Tree Node
class TreeNode { constructor ( ) { this . val = 0 ; this . left = null ; this . right = null ; } } ; function newNode ( key ) { var temp = new TreeNode ( ) ; temp . val = key ; temp . left = temp . right = null ; return temp ; }