Helper Function to return a random node
int randomNodeUtil ( Node * root , int count ) { if ( ! root ) 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 ) ; }