Is this a proper way to insert a node after the first for a doubly linked list? : <pre><code>NodePtr p = new Node(id, age, email)
p-&gt;prev = top;
p-&gt;next = top-&gt;next;
top-&gt;next = p;
top-&gt;next-&gt;prev = p;
</code></pre>

<p>I am trying to insert node p after the first node. </p>

<p>I am trying to teach myself how to use doubly linked lists. When I draw it out, it looks like it would work. I just wanted confirmation if this is correct. If this is not correct, how should I fix it?</p>
