关于一个已排序成功的链表的内容处理问题
//多项式指数排序void Rank (Count * pHead){ struct Count * p = pHead->pNext; struct Count * temp; while (p != NULL) { while (p->pNext != NULL) { if (pHead->pNext->Last > p->pNext->Last) { temp = pHead->pNext; pHead->pNext = p->pNext; p->pNext = pHead->pNext->pNext; pHead->pNext->pNext = temp; } else p = p->pNext; } pHead = pHead->pNext; p = pHead->pNext; } return;}void Handle (Count * pHead){ struct Count * p_First = pHead->pNext; struct Count * p_After = pHead->pNext->pNext; while (p_First != NULL) { if (p_First->Last == p_After->Last) { p_First->Val += p_After->Val; p_First->pNext = p_After->pNext; p_After = p_After->pNext; } else { p_First = p_First->pNext; p_After = p_After->pNext; } } return;}while (p_First != NULL && p_After != NULL)//这里要一起判断,不然里边用到p_After会出错