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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dlinkedlist.h

?? 以圖形界面的方式形象的描述了數(shù)據(jù)結(jié)構(gòu)中翰諾塔的過程
?? H
?? 第 1 頁 / 共 2 頁
字號(hào):
// ----------------------------------------------------------------
    void InsertBefore( DListIterator<Datatype>& p_iterator, Datatype p_data )
    {
        if( p_iterator.m_node != 0 )
        {
            // insert the data before the iterator
            p_iterator.m_node->InsertBefore( p_data );

            // if the iterator was the head of the list,
            // reset the head pointer.
            if( p_iterator.m_node == m_head )
                m_head = m_head->m_previous;

            // increment the count
            m_count++;
        }
        else
        {
            Prepend( p_data );
        }
    }


// ----------------------------------------------------------------
//  Name:           Remove
//  Description:    Removes the node that the iterator points to.
//                  moves iterator forward to the next node.
//  Arguments:      p_iterator: The iterator to remove
//  Return Value:   None.
// ----------------------------------------------------------------
    void Remove( DListIterator<Datatype>& p_iterator )
    {
        // temporary node pointer.
        DListNode<Datatype>* node;

        // if node is invalid, do nothing.
        if( p_iterator.m_node == 0 )
            return;


        // save the pointer to the node we want to delete.
        node = p_iterator.m_node;

        // if the node we want to remove is the head or the tail
        // nodes, then move the head or tail to the next or
        // previous node.
        if( node == m_head )
        {
            m_head = m_head->m_next;
        }
        else if( node == m_tail )
        {
            m_tail = m_tail->m_previous;
        }

        // move the iterator forward to the next valid node
        p_iterator.Forth();

        // delink and delete the node.
        node->Delink();
        delete node;

        // if the head is 0, then set the tail to 0 as well.
        if( m_head == 0 )
            m_tail = 0;
        
        m_count--;
    }



// ----------------------------------------------------------------
//  Name:           GetIterator
//  Description:    Gets an iterator pointing to the beginning
//                  of the list.
//  Arguments:      None.
//  Return Value:   iterator pointing to the beginning of the list.
// ----------------------------------------------------------------
    DListIterator<Datatype> GetIterator()
    {
        return DListIterator<Datatype>( this, m_head );
    }


// ----------------------------------------------------------------
//  Name:           Size
//  Description:    Gets the size of the list
//  Arguments:      None.
//  Return Value:   size of the list.
// ----------------------------------------------------------------
    int Size()
    {
        return m_count;
    }


// ----------------------------------------------------------------
//  Name:           SaveToDisk
//  Description:    Saves the linked list to disk.
//  Arguments:      p_filename: name of the file to save to.
//  Return Value:   true, if successful
// ----------------------------------------------------------------
    bool SaveToDisk( char* p_filename )
    {
        FILE* outfile = 0;
        DListNode<Datatype>* itr = m_head;

        // open the file
        outfile = fopen( p_filename, "wb" );

        // return if it couldn't be opened
        if( outfile == 0 )
            return false;

        // write the size of the list first
        fwrite( &m_count, sizeof( int ), 1, outfile );

        // now loop through and write the list.
        while( itr != 0 )
        {
            fwrite( &(itr->m_data), sizeof( Datatype ), 1, outfile );
            itr = itr->m_next;
        }

        fclose( outfile );

        // return success.
        return true;
    }


// ----------------------------------------------------------------
//  Name:           ReadFromDisk
//  Description:    Reads a linked list from a file.
//  Arguments:      p_filename: the name of the file to read from
//  Return Value:   true if successful.
// ----------------------------------------------------------------
    bool ReadFromDisk( char* p_filename )
    {
        FILE* infile = 0;
        Datatype buffer;
        int count = 0;

        // open the file
        infile = fopen( p_filename, "rb" );

        // return if it couldn't be opened
        if( infile == 0 )
            return false;

        // read the size of the list first
        fread( &count, sizeof( int ), 1, infile );

        // now loop through and read the list.
        while( count != 0 )
        {
            fread( &buffer, sizeof( Datatype ), 1, infile );
            Append( buffer );
            count--;
        }

        fclose( infile );

        // return success.
        return true;
    }


// ----------------------------------------------------------------
//  Name:           m_head
//  Description:    The first node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_head;

// ----------------------------------------------------------------
//  Name:           m_tail
//  Description:    The last node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_tail;

// ----------------------------------------------------------------
//  Name:           m_count
//  Description:    The number of nodes in the list
// ----------------------------------------------------------------
    int m_count;
};




// -------------------------------------------------------
// Name:        DListIterator
// Description: This is the basic linked list 
//              iterator class.
// -------------------------------------------------------
template<class Datatype>
class DListIterator
{
public:


// ----------------------------------------------------------------
//  Name:           DListIterator
//  Description:    Constructor, creates an iterator that points
//                  to the given list and node. 
//  Arguments:      p_list: pointer to the list the iterator belongs
//                          to.
//                  p_node: pointer to the current node.
//  Return Value:   None.
// ----------------------------------------------------------------
    DListIterator( DLinkedList<Datatype>* p_list = 0,
                   DListNode<Datatype>* p_node = 0 )
    {
        m_list = p_list;
        m_node = p_node;
    }


// ----------------------------------------------------------------
//  Name:           Start
//  Description:    Resets the iterator to the beginning of the 
//                  list
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Start()
    {
        if( m_list != 0 )
            m_node = m_list->m_head;
    }

// ----------------------------------------------------------------
//  Name:           End
//  Description:    Resets the iterator to the end of the list
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void End()
    {
        if( m_list != 0 )
            m_node = m_list->m_tail;
    }


// ----------------------------------------------------------------
//  Name:           Forth
//  Description:    Moves the iterator forward by one position
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Forth()
    {
        if( m_node != 0 )
            m_node = m_node->m_next;
    }


// ----------------------------------------------------------------
//  Name:           Back
//  Description:    Moves the iterator backward by one position.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Back()
    {
        if( m_node != 0 )
            m_node = m_node->m_previous;
    }


// ----------------------------------------------------------------
//  Name:           Item
//  Description:    Gets the item that the iterator is pointing to.
//  Arguments:      None.
//  Return Value:   Reference to the data in the node.
// ----------------------------------------------------------------
    Datatype& Item()
    {
        return m_node->m_data;
    }


// ----------------------------------------------------------------
//  Name:           Valid
//  Description:    Determines if the node is valid.
//  Arguments:      None.
//  Return Value:   true if valid
// ----------------------------------------------------------------
    bool Valid()
    {
        return (m_node != 0);
    }


// ----------------------------------------------------------------
//  Name:           operator==
//  Description:    Determines if two iterators point to the same
//                  node.
//  Arguments:      None.
//  Return Value:   true if they point to the same node.
// ----------------------------------------------------------------
    bool operator==( DListIterator<Datatype>& p_rhs )
    {
        if( m_node == p_rhs.m_node && m_list == p_rhs.m_list )
        {
            return true;
        }
        return false;
    }



// ----------------------------------------------------------------
//  Name:           m_node
//  Description:    pointer to the current node
// ----------------------------------------------------------------
    DListNode<Datatype>* m_node;


// ----------------------------------------------------------------
//  Name:           m_list
//  Description:    pointer to the current list.
// ----------------------------------------------------------------
    DLinkedList<Datatype>* m_list;
};



#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产福利| 激情五月婷婷综合| 日本一区二区三区dvd视频在线| 欧美色国产精品| 精品视频在线免费看| 在线观看一区二区精品视频| 色吧成人激情小说| 在线电影一区二区三区| 欧美精品久久一区| 日韩免费观看2025年上映的电影| 欧美一级专区免费大片| 精品99一区二区| 国产精品美女久久久久av爽李琼 | 久久99深爱久久99精品| 国模少妇一区二区三区| 国产成人在线免费| 本田岬高潮一区二区三区| 91蝌蚪porny| 欧美一区二区三区免费观看视频| 精品国产伦一区二区三区免费| 欧美国产日韩a欧美在线观看| 亚洲人成人一区二区在线观看 | 欧美日韩和欧美的一区二区| 欧美一区二区三区在线看| 国产喂奶挤奶一区二区三区| 中文字幕日韩精品一区| 婷婷中文字幕一区三区| 国产一区999| 欧美日韩一二三| 2023国产一二三区日本精品2022| 亚洲欧美综合色| 亚洲成人一区二区| 国产精品综合网| 欧美日韩五月天| 国产精品美女一区二区三区| 首页国产欧美日韩丝袜| 成人免费高清在线| 555www色欧美视频| 亚洲欧美日本在线| 国产精品一级黄| 在线电影欧美成精品| 亚洲人成影院在线观看| 国产精品夜夜嗨| 日韩一区二区精品在线观看| 一区二区三区在线观看国产| 国产一区二区在线观看免费| 欧美午夜寂寞影院| 椎名由奈av一区二区三区| 国产原创一区二区| 91精品欧美久久久久久动漫| 中文字幕日韩av资源站| 国产精品18久久久久| 日韩视频在线永久播放| 亚洲一区二区欧美| 91小视频免费观看| 国产精品国产三级国产aⅴ入口| 国内一区二区视频| 日韩视频永久免费| 亚洲www啪成人一区二区麻豆| 99精品在线观看视频| 国产亚洲va综合人人澡精品| 精品一区二区成人精品| 欧美一级在线视频| 秋霞午夜av一区二区三区| 欧美日韩五月天| 亚洲成人在线免费| 欧美日韩国产高清一区二区 | 亚洲精品自拍动漫在线| 成人综合婷婷国产精品久久蜜臀| 精品福利在线导航| 精品制服美女久久| 欧美xingq一区二区| 六月婷婷色综合| 精品少妇一区二区三区免费观看| 日韩中文字幕1| 日韩网站在线看片你懂的| 蜜桃视频在线观看一区二区| 欧美大片在线观看一区二区| 久久精品国产网站| 亚洲精品在线观看网站| 国产一区二区视频在线播放| 久久久综合网站| 成人晚上爱看视频| 亚洲伦理在线免费看| 在线观看视频一区二区欧美日韩| 性做久久久久久| 欧美不卡123| 成人丝袜18视频在线观看| 亚洲欧洲成人精品av97| 欧美性受xxxx黑人xyx| 日本亚洲免费观看| 久久色视频免费观看| av电影天堂一区二区在线| 一区二区三区不卡视频| 777奇米成人网| 福利视频网站一区二区三区| 一区二区三区中文字幕电影| 日韩三区在线观看| 国产成人夜色高潮福利影视| 亚洲免费观看视频| 91精品国产色综合久久| 成人午夜视频在线| 午夜精品视频在线观看| 精品美女一区二区三区| av激情综合网| 老司机精品视频线观看86| 国产精品第四页| 日韩西西人体444www| 成人动漫一区二区| 日韩成人精品在线| 国产精品盗摄一区二区三区| 欧美一级片免费看| 成人av动漫在线| 蜜乳av一区二区| 亚洲日本青草视频在线怡红院| 日韩一级高清毛片| 色噜噜夜夜夜综合网| 韩国av一区二区三区四区| 亚洲bt欧美bt精品777| 国产精品每日更新| 日韩一级免费观看| 色婷婷亚洲一区二区三区| 国产一区二区不卡老阿姨| 天天做天天摸天天爽国产一区| 欧美激情一区在线| 日韩精品中文字幕一区二区三区| 91在线看国产| 成人亚洲精品久久久久软件| 另类综合日韩欧美亚洲| 首页欧美精品中文字幕| 一区二区三区四区在线| 中文字幕在线不卡| 国产三级三级三级精品8ⅰ区| 91麻豆精品国产自产在线| 日本乱码高清不卡字幕| av在线不卡免费看| 懂色av噜噜一区二区三区av| 狠狠色综合播放一区二区| 日韩av中文在线观看| 亚洲国产综合人成综合网站| 亚洲男同性恋视频| 国产精品天美传媒沈樵| 国产欧美一区二区三区在线看蜜臀| 欧美精品一区二区高清在线观看| 91精品国产91久久久久久最新毛片 | 亚洲女性喷水在线观看一区| 久久女同互慰一区二区三区| 日韩一区二区免费在线电影| 91精品国产综合久久精品麻豆 | 久久久三级国产网站| 精品欧美乱码久久久久久1区2区| 7777精品伊人久久久大香线蕉完整版| 欧美视频精品在线观看| 欧美日韩精品电影| 欧美一区二区三区免费在线看| 日韩亚洲欧美高清| 欧美tickling网站挠脚心| 精品欧美一区二区久久| 久久欧美中文字幕| 中文字幕在线观看一区二区| 亚洲欧洲日韩av| 艳妇臀荡乳欲伦亚洲一区| 丝袜美腿高跟呻吟高潮一区| 日本vs亚洲vs韩国一区三区二区| 免费观看30秒视频久久| 久久99精品久久久| 波波电影院一区二区三区| 91在线一区二区| 欧美精品在线观看播放| 久久伊人中文字幕| 综合色中文字幕| 日本不卡一区二区三区高清视频| 激情五月激情综合网| 99久久久精品| 日韩欧美国产电影| 国产亚洲精品7777| 亚洲电影第三页| 经典三级视频一区| 91日韩在线专区| 日韩一区二区三区免费观看| 亚洲国产精品精华液ab| 亚洲一区二区三区视频在线| 韩国女主播一区二区三区| 成人黄色在线看| 日韩欧美电影在线| 亚洲日本va午夜在线影院| 蜜臀av一级做a爰片久久| 成人97人人超碰人人99| 91精品一区二区三区在线观看| 国产精品人成在线观看免费| 五月综合激情网| 91在线视频18| 久久久久99精品国产片| 日韩精品亚洲一区二区三区免费| 成人免费av资源| 精品国产乱码久久久久久久久| 亚洲免费高清视频在线| 成人综合在线观看| 精品国内片67194| 日韩av二区在线播放|