寫正確函數須要注意的地方:鏈表的及時終止冒泡排序

Node* sort(Node* phead) { if (NULL==phead || NULL==phead->pNext) { return phead; } Node* ptemp=phead; Node* plastchangepoint=NULL;//標記上一次 while (plastchangepoint!=phead->pNext) { bool chan
相關文章
相關標籤/搜索