I am trying to print a non static binary tree.
It does print but it rotates towards the left. I cant find a way to correct this and make it rotate upright. 5 is the root node. Code:

```
template <class dataType>
void displaybinarytree(BinaryTree <dataType> * p, int indent)
{
if(p != NULL) {
    if(p->right()) {
        displaybinarytree(p->right(), indent+4);
    }

    if (indent) {
        cout << setw(indent) << ' ';
    }

    if (p->right()){
        cout<<" /\n" << setw(indent) << ' ';
    }

    cout<< p->getData() << "\n ";

    if(p->left()) {
        cout << setw(indent) << ' ' <<" \\\n";
        displaybinarytree(p->left(), indent+4);
    }
  }
}

```

Output:

![](https://i.stack.imgur.com/5UqF3.png)

Expected output:

![](https://i.stack.imgur.com/MfuUU.png)