Given Generic Tree
let root = newNode ( 1 ) ; ( root . child ) . push ( newNode ( 2 ) ) ; ( root . child ) . push ( newNode ( 3 ) ) ; ( root . child [ 0 ] . child ) . push ( newNode ( 4 ) ) ; ( root . child [ 1 ] . child ) . push ( newNode ( 6 ) ) ; ( root . child [ 0 ] . child ) . push ( newNode ( 5 ) ) ; ( root . child [ 1 ] ) . child . push ( newNode ( 7 ) ) ; ( root . child [ 1 ] . child ) . push ( newNode ( 8 ) ) ;