Hacker News new | ask | show | jobs
by chacham15 4422 days ago
You're right. Enqueue is wrong, it should be:

    if ( !m_pHead )
        m_pHead = p ;
    else
        m_pTail->next = p;
    m_pTail = p;
For some reason, the author is inserting the node in front of the tail leading to the error.