0

I want help in linked list implementation of a tree. A tree node has three child. using pointers: Parent, Siblings and FirstChild.

I have tried making it but couldn't get it to work. I need help in inserting new nodes

void InsertFirstChild(Node newNode)
{
    newNode.m_Parent = this;
    newNode.m_NextSibling = m_FirstChild;

    if (m_FirstChild != null)
        m_FirstChild.m_PrevSibling = newNode;
    else
        m_LastChild = newNode;

    m_FirstChild = newNode;
}
No Idea For Name
  • 11,411
  • 10
  • 42
  • 70

0 Answers0