可以这样写吗
bool List::ListInsertHead(Node *pNode)//在头结点后面插入元素
{
Node *newNode = new Node;
if(newNode == NULL)
return false;
newNode->data = pNode->data;
newNode->next = m_pNode->next;
m_pNode->next = newNode;
return true;
}
bool List::ListInsertHead(Node *pNode)//在头结点后面插入元素
{
Node *newNode = new Node;
if(newNode == NULL)
return false;
newNode->data = pNode->data;
newNode->next = m_pNode->next;
m_pNode->next = newNode;
return true;
}
2016-08-28
举报