Driver code
let root = null ; let key = [ 20 , 8 , 22 , 4 , 12 , 10 , 14 ] ; for ( let i = 0 ; i < key . length ; i ++ ) { root = insert ( root , key [ i ] ) ; } let k = 3 ; printKthSmallest ( root , k ) ;