0

Hello. I am having hard time understanding recussion in binary search tree. Assuming we have 6,4,7 in our tree the following inorder function should print 4,6,7 and I don't understand how it's done. Can somebody help explaining in more detail. Thank You.

```
void BinarySearchTree::print_inorder()
{
inorder(root);
}
void BinarySearchTree::inorder(tree_node* p)
{
if(p != NULL)
{
if(p->left) inorder(p->left);
cout<<" "<<p->data<<" ";
if(p->right) inorder(p->right);
}
else return;
}
```