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