int main() { }
void addTotail(ListNode *& pHead, int value) { ListNode *node = new ListNode(); node->value = value; node->pNext = NULL; ListNode *p = pHead; if (p == NULL) { pHead = node; return; } while (p->pNext != NULL) { p = p->pNext; } p->pNext = node; }
时间: 2024-10-25 23:50:48