A utility function to print preorder traversal of the tree . The function also prints height of every node
void preOrder ( struct node * root ) { if ( root != NULL ) { printf ( " % d ( % d ) ▁ " , root -> key , root -> count ) ; preOrder ( root -> left ) ; preOrder ( root -> right ) ; } }