Binary tree C++ basics
<pre><code>void BinarySearchTree::insert(int d)
{
    tree_node* t = new tree_node;
    tree_node* parent;
    t-&gt;data = d;
    t-&gt;left = NULL;
    t-&gt;right = NULL;
    parent = NULL;

    // is this a new tree?
    if(isEmpty()) root = t;
    else
    {
        //Note: ALL insertions are as leaf nodes
        tree_node* curr;
        curr = root;
        // Find the Node's parent
        while(curr)
        {
            parent = curr;
            if(t-&gt;data &gt; curr-&gt;data) curr = curr-&gt;right;
            else curr = curr-&gt;left;
        }

        if(t-&gt;data &lt; parent-&gt;data)
           parent-&gt;left = t;
        else
           parent-&gt;right = t;
    }
}
</code></pre>

<p>Questions:</p>

<ol>
<li><p>Why do I need to allocate memory for <strong>tree_node* t;</strong> using new but not for <strong>tree_node* parent;</strong>?</p></li>
<li><p>What exactly is tree_node* what does it look like in memory and what does it do?</p></li>
<li><p>Can someone explain to me the -> operator and how it works?</p></li>
</ol>
