A utility function to print tree
void preorder ( Node * root ) { if ( root ) { cout << " key : ▁ " << root -> key ; if ( root -> left ) cout << " ▁ | ▁ left ▁ child : ▁ " << root -> left -> key ; if ( root -> right ) cout << " ▁ | ▁ right ▁ child : ▁ " << root -> right -> key ; cout << endl ; preorder ( root -> left ) ; preorder ( root -> right ) ; } }