1. 程式人生 > >C++連結串列使用完整程式碼

C++連結串列使用完整程式碼

{
        
case1:
            printf(
"連結串列所有節點資料如下: ");
            printNode(pHead);
            
break;
        
case2:
            printf(
"請輸入要查詢的節點的ID: ");
            scanf(
"%d",&uID);
            pDest 
= searchNode(pHead, uID);
            
if (pDest != NULL)
            
{
                printf(
"已找到節點,名字為:%s
",pDest->strName);
            }

            
break;
        
case3:
            printf(
"請輸入要刪除的節點的ID: ");
            scanf(
"%d",&uID);
            pHead 
= deleteNode(pHead, uID);
            
break;
        
case4:
            printf(
"請輸入要刪除的節點的ID: ");
            scanf(
"%d",&uID);
            pHead 
=
 insertNode(pHead, uID);
            
break;
        
case5:
            isExit 
=true;
            printf(
"程式已退出! ");
            
break;
        
default:
            printf(
"按鍵錯誤,請重新選擇! ");
            
break;
        }