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 ) { Console . Write ( root . key + " ( " + root . count + " ) ▁ " ) ; preOrder ( root . left ) ; preOrder ( root . right ) ; } }