91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

合并兩個已序單鏈表

發布時間:2020-08-05 23:20:28 來源:網絡 閱讀:276 作者:淺唱逝流年 欄目:編程語言

// 合并兩個已序單鏈表

PSListNode MergeList(PSListNode pL1, PSListNode pL2)

{

                 PSListNode pNewHead = NULL ;

                 PSListNode pL1Node = pL1 ;

                 PSListNode pL2N0de = pL2 ;

                 PSListNode pNode = NULL ;

                 PSListNode pTailNode = NULL ;

                 if (pL1 == NULL)

                {

                                 return pL2 ;

                }

                 if (pL2 == NULL)

                {

                                 return pL1 ;

                }

                 if (pL1Node->data > pL2N0de->data)

                {

                                pNode = pL2N0de;

                                pL2N0de = pL2N0de->pNext;

                }

                 else

                {

                                pNode = pL1Node;

                                pL1Node = pL1Node->pNext;

                }

                pNewHead = pNode;

                pTailNode = pNode;

                 while (pL1Node&&pL2N0de)

                {

                                 if (pL1Node->data > pL2N0de->data)

                                {

                                                pNode = pL2N0de;

                                                pL2N0de = pL2N0de->pNext;

                                }

                                 else

                                {

                                                pNode = pL1Node;

                                                pL1Node = pL1Node->pNext;

                                }

                                pTailNode->pNext = pNode;

                                pTailNode = pTailNode->pNext;

                }

                 if (pL1Node == NULL )

                {

                                pTailNode->pNext = pL2N0de;

                }

                 else

                {

                                pTailNode->pNext = pL1Node;

                }

                 return pNewHead;

}


void Print(PSListNode pHead)

{

                 PSListNode pCurNode = pHead ;

                 while (pCurNode)

                {

                                printf( "%d->", pCurNode->data);

                                pCurNode = pCurNode->pNext;

                }

                printf( "NULL\n");

}


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

铜鼓县| 郯城县| 宝坻区| 商洛市| 乐都县| 牙克石市| 女性| 平邑县| 涿鹿县| 彝良县| 江西省| 新河县| 汕头市| 河津市| 新巴尔虎右旗| 遵化市| 玉山县| 永靖县| 黑河市| 田阳县| 清河县| 穆棱市| 永新县| 遂宁市| 眉山市| 渝中区| 吴忠市| 通海县| 江陵县| 聊城市| 阳原县| 富蕴县| 荣昌县| 五常市| 南溪县| 兰西县| 凤山县| 乌兰浩特市| 彭阳县| 洛阳市| 赤水市|