bool List:: ListInsertHead(Node *pNode )
{
Node *temp = m_pList->next; //m_pList是在链表里的一个Node指针
m_pList->next = NULL;
ListInsertTail(pNode);
ListInsertTail(temp);
m_iLenth++;
return true;
}
bool List::ListInsertTail(Node *pNode)
{
Node *currentNode = m_pList;
while (currentNode ->next!=NULL ) {
currentNode = currentNode->next;
}
ListSetNull(pNode);
currentNode->next = pNode;
m_iLenth++;
return true;
}
bool List::ListSetNull(Node *pNode)
{
Node *currentNode = pNode;
while (currentNode->next != NULL) {
currentNode = currentNode->next;
}
currentNode->next = NULL;
return true;
}
目前暂无任何回答
- 0 回答
- 0 关注
- 1378 浏览
添加回答
举报
0/150
提交
取消