亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? unorderedlinkedlist.h

?? C++編成數據結構與程序設計方法 D.S.Malk編著
?? H
字號:
#ifndef H_UnorderedLinkedList
#define H_UnorderedLinkedList

#include "linkedList.h"

using namespace std;

template <class Type>
class unorderedLinkedList: public linkedListType<Type>
{
public:
    bool search(const Type& searchItem) const;
      //Function to determine whether searchItem is in the list.
      //Postcondition: Returns true if searchItem is in the 
      //               list, otherwise the value false is 
      //               returned.

    void insertFirst(const Type& newItem);
      //Function to insert newItem at the beginning of the list.
      //Postcondition: first points to the new list, newItem is
      //               inserted at the beginning of the list,
      //               last points to the last node in the  
      //               list, and count is incremented by 1.

    void insertLast(const Type& newItem);
      //Function to insert newItem at the end of the list.
      //Postcondition: first points to the new list, newItem 
      //               is inserted at the end of the list,
      //               last points to the last node in the 
      //               list, and count is incremented by 1.

    void deleteNode(const Type& deleteItem);
      //Function to delete deleteItem from the list.
      //Postcondition: If found, the node containing 
      //               deleteItem is deleted from the list.
      //               first points to the first node, last
      //               points to the last node of the updated 
      //               list, and count is decremented by 1.
};


template <class Type>
bool unorderedLinkedList<Type>::
                   search(const Type& searchItem) const
{
    nodeType<Type> *current; //pointer to traverse the list
    bool found = false;
    
    current = first; //set current to point to the first 
                     //node in the list

    while (current != NULL && !found)    //search the list
        if (current->info == searchItem) //searchItem is found
            found = true;
        else
            current = current->link; //make current point to
                                     //the next node
    return found; 
}//end search

template <class Type>
void unorderedLinkedList<Type>::insertFirst(const Type& newItem)
{
    nodeType<Type> *newNode; //pointer to create the new node

    newNode = new nodeType<Type>; //create the new node

    newNode->info = newItem;    //store the new item in the node
    newNode->link = first;      //insert newNode before first
    first = newNode;            //make first point to the
                                //actual first node
    count++;                    //increment count

    if (last == NULL)   //if the list was empty, newNode is also 
                        //the last node in the list
        last = newNode;
}//end insertFirst

template <class Type>
void unorderedLinkedList<Type>::insertLast(const Type& newItem)
{
    nodeType<Type> *newNode; //pointer to create the new node

    newNode = new nodeType<Type>; //create the new node

    newNode->info = newItem;  //store the new item in the node
    newNode->link = NULL;     //set the link field of newNode
                              //to NULL

    if (first == NULL)  //if the list is empty, newNode is 
                        //both the first and last node
    {
        first = newNode;
        last = newNode;
        count++;        //increment count
    }
    else    //the list is not empty, insert newNode after last
    {
        last->link = newNode; //insert newNode after last
        last = newNode; //make last point to the actual 
                        //last node in the list
        count++;        //increment count
    }
}//end insertLast


template <class Type>
void unorderedLinkedList<Type>::deleteNode(const Type& deleteItem)
{
    nodeType<Type> *current; //pointer to traverse the list
    nodeType<Type> *trailCurrent; //pointer just before current
    bool found;

    if (first == NULL)    //Case 1; the list is empty. 
        cout << "Cannot delete from an empty list."
             << endl;
    else
    {
        if (first->info == deleteItem) //Case 2 
        {
            current = first;
            first = first->link;
            count--;
            if (first == NULL)    //the list has only one node
                last = NULL;
            delete current;
        }
        else //search the list for the node with the given info
        {
            found = false;
            trailCurrent = first;  //set trailCurrent to point
                                   //to the first node
            current = first->link; //set current to point to 
                                   //the second node

            while (current != NULL && !found)
            {
                if (current->info != deleteItem) 
                {
                    trailCurrent = current;
                    current = current-> link;
                }
                else
                    found = true;
            }//end while

            if (found) //Case 3; if found, delete the node
            {
                trailCurrent->link = current->link;
                count--;

                if (last == current)   //node to be deleted 
                                       //was the last node
                    last = trailCurrent; //update the value 
                                         //of last
                delete current;  //delete the node from the list
            }
            else
                cout << "The item to be deleted is not in "
                     << "the list." << endl;
        }//end else
    }//end else
}//end deleteNode


#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩久久精品一区| 欧美亚一区二区| 国产乱码精品一区二区三区av| 亚洲成人精品影院| 亚洲国产成人精品视频| 亚洲一区二区av在线| 亚洲成人精品在线观看| 午夜精品成人在线视频| 麻豆成人在线观看| 黄色资源网久久资源365| 国产一区二区三区日韩| 国产乱码精品一品二品| 北条麻妃国产九九精品视频| 色猫猫国产区一区二在线视频| 欧美性受极品xxxx喷水| 精品国产免费久久| 一区二区三区四区不卡在线| 中文字幕一区日韩精品欧美| 国产欧美在线观看一区| 一区二区免费看| 免费国产亚洲视频| 久久er99精品| 欧美在线看片a免费观看| 亚洲精品在线网站| 亚洲一区二区三区免费视频| 黑人精品欧美一区二区蜜桃| 欧美伊人久久大香线蕉综合69 | 精品国产91久久久久久久妲己| 久久精品免视看| 人人爽香蕉精品| 91麻豆精东视频| 国产精品二区一区二区aⅴ污介绍| 丝袜亚洲另类欧美| 色婷婷激情久久| 国产精品人成在线观看免费 | 7777精品久久久大香线蕉| 久久久久久久久久久黄色| 丝瓜av网站精品一区二区| av一二三不卡影片| 综合av第一页| 91亚洲精品一区二区乱码| 国产精品美女久久久久久2018 | 国产精品视频第一区| 国内精品久久久久影院色| 日韩一级二级三级| 琪琪一区二区三区| 欧美嫩在线观看| 日韩美女视频19| 成人免费精品视频| 中文字幕永久在线不卡| av在线不卡电影| 亚洲精品国产a久久久久久 | 国产精品成人在线观看| 国产91丝袜在线播放0| 国产精品毛片久久久久久| 9i在线看片成人免费| 一区二区欧美国产| 欧美亚洲国产一区在线观看网站 | 波多野结衣在线aⅴ中文字幕不卡| 国产日韩欧美综合一区| 欧美主播一区二区三区| 日韩影院免费视频| 欧美一级日韩不卡播放免费| 美国欧美日韩国产在线播放| 2023国产精华国产精品| 不卡av在线网| 激情综合色播五月| 国产精品久久久99| 26uuu亚洲综合色| 一本久久综合亚洲鲁鲁五月天 | 国产欧美日产一区| 欧美亚洲一区三区| 成人美女视频在线看| 日本亚洲天堂网| 亚洲欧美在线高清| 欧美午夜片在线看| 91啪亚洲精品| 国产不卡在线一区| 日本欧美大码aⅴ在线播放| 国产精品天美传媒| 2021国产精品久久精品| 欧美日韩亚洲另类| 色噜噜狠狠成人网p站| 国产成人在线色| 青青草精品视频| 亚洲在线中文字幕| 一区二区成人在线视频| 日韩一区在线看| 最近中文字幕一区二区三区| 久久久久久黄色| 亚洲国产精品黑人久久久| 精品日产卡一卡二卡麻豆| 欧美电视剧免费全集观看| 欧美一区二区三区的| 欧美日韩1区2区| 337p日本欧洲亚洲大胆精品| 日韩欧美一二区| 国产欧美日韩另类一区| 中文字幕在线播放不卡一区| 亚洲精品国产第一综合99久久 | 91国模大尺度私拍在线视频| 在线精品视频一区二区三四 | 亚洲精品videosex极品| 日韩精品一二区| 高清视频一区二区| 在线观看一区不卡| 日韩免费成人网| 欧美妇女性影城| 91影视在线播放| 3751色影院一区二区三区| 日韩一级黄色片| 亚洲免费三区一区二区| 午夜伦欧美伦电影理论片| 国产a精品视频| 91精品国产91综合久久蜜臀| 欧美国产一区在线| 日本91福利区| 91国产成人在线| 国产精品久久久一本精品| 奇米影视一区二区三区| 日本道色综合久久| 中文字幕不卡在线观看| 美女精品自拍一二三四| 在线观看网站黄不卡| ...av二区三区久久精品| 激情综合色丁香一区二区| 日韩欧美国产综合| 偷窥国产亚洲免费视频| 日本高清不卡视频| 中文字幕视频一区| 99久久伊人精品| 国产精品国产三级国产三级人妇| 美女视频黄 久久| 日韩欧美一区二区在线视频| 日韩影院精彩在线| 欧美一区二区三区电影| 久久99最新地址| 欧美sm极限捆绑bd| 国产精品自在欧美一区| 久久久一区二区| aaa亚洲精品| 亚洲成人第一页| 精品日韩一区二区三区免费视频| 激情综合网av| 亚洲品质自拍视频网站| 欧洲一区二区av| 精一区二区三区| 亚洲欧美偷拍卡通变态| 欧美二区在线观看| 丁香网亚洲国际| 亚洲三级在线免费观看| 欧美亚洲丝袜传媒另类| 青青国产91久久久久久| 欧美韩日一区二区三区| 91丝袜美女网| 青娱乐精品视频| 国产精品免费aⅴ片在线观看| 色综合一区二区| 国产黑丝在线一区二区三区| 一区二区三区国产精华| 久久久久久久精| 在线电影院国产精品| 国产精品自在欧美一区| 七七婷婷婷婷精品国产| 亚洲精品久久嫩草网站秘色| 久久久精品国产免大香伊| 欧美在线一区二区三区| 99在线精品视频| 久久99国产精品尤物| 日韩精品一二区| 亚洲第一搞黄网站| 亚洲已满18点击进入久久| 欧美高清在线视频| 欧美高清在线一区| 国产无人区一区二区三区| 欧美欧美午夜aⅴ在线观看| 欧美专区日韩专区| 色妹子一区二区| 欧美日韩视频在线一区二区| 91在线精品一区二区三区| 99re这里只有精品视频首页| 国产999精品久久久久久| 国产成人在线看| 成人三级伦理片| 色天使色偷偷av一区二区| 色综合天天狠狠| 欧美日韩一二三区| 欧美一区二区三区精品| 久久天天做天天爱综合色| 国产视频一区不卡| 一区二区欧美视频| 日日夜夜精品免费视频| 国产原创一区二区三区| 成人av网站大全| 777欧美精品| 亚洲乱码国产乱码精品精可以看| 日韩你懂的在线播放| 国产三级精品三级| 亚洲制服欧美中文字幕中文字幕| 欧美aaaaaa午夜精品|