Given N - Ary tree
let root = new Node ( 1 ) ; ( root . child ) . push ( new Node ( 2 ) ) ; ( root . child ) . push ( new Node ( 3 ) ) ; ( root . child [ 0 ] . child ) . push ( new Node ( 4 ) ) ; ( root . child [ 1 ] . child ) . push ( new Node ( 5 ) ) ; ( root . child [ 1 ] . child ) . push ( new Node ( 6 ) ) ; ( root . child [ 1 ] . child [ 1 ] . child ) . push ( new Node ( 7 ) ) ; ( root . child [ 1 ] . child [ 1 ] . child ) . push ( new Node ( 8 ) ) ;