Helper Function to return a random node
function randomNodeUtil ( root , count ) { if ( root == null ) return 0 ; if ( count == children ( root . left ) ) return root . data ; if ( count < children ( root . left ) ) return randomNodeUtil ( root . left , count ) ; return randomNodeUtil ( root . right , count - children ( root . left ) - 1 ) ; }