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;
}
C10H16N5O13P3
随时随地看视频慕课网APP
相关分类