下面的資料是關於C++算法之鏈表排序的代碼。算法
{ return; while(curr){ prev = curr; curr = curr->next; insert_for_sort_operation(ppNode, prev); } return; } b)對於待插入的節點,選擇合適的位置插入便可 { return; } while(cur){ if(pNode->data < cur->data) break; prev = cur; cur = cur->next; } pNode->next = prev->next; prev->next = pNode; return; }