create a binary tree
let root = newNode ( 20 ) ; root . left = newNode ( 10 ) ; root . right = newNode ( 30 ) ; root . left . left = newNode ( 5 ) ; root . left . right = newNode ( 15 ) ; root . left . right . left = newNode ( 12 ) ; root . right . left = newNode ( 25 ) ; root . right . right = newNode ( 40 ) ; document . write ( " " ) ; let ret = printKDistant ( root , 1 ) ; if ( ret == false ) document . write ( " " + " " + " " ) ; document . write ( " " ) ; ret = printKDistant ( root , 2 ) ; if ( ret == false ) document . write ( " " + " " + " " ) ; document . write ( " " ) ; ret = printKDistant ( root , 3 ) ; if ( ret == false ) document . write ( " " + " " + " " ) ; document . write ( " " ) ; ret = printKDistant ( root , 6 ) ; if ( ret == false ) document . write ( " " + " " + " " ) ;