void BinaryTree::inOrderDisplay(TreeNode* node){ if(NULL == node) return; else { inOrderDisplay(node->left); node->display(); inOrderDisplay(node->right); } }
//--------------------------------------------------------------------------- // inOrderDisplay // Displays BST inorder with a single space between values. void BinTree::inOrderDisplay(Node* current) const { if (current != NULL) // traverse and print data { inOrderDisplay(current->left); cout << *current->data << " "; inOrderDisplay(current->right); } }
void BinaryTree::inOrderDisplay(){ inOrderDisplay(root); }