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

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

?? dlinkedlist.h

?? 以圖形界面的方式形象的描述了數據結構中翰諾塔的過程
?? H
?? 第 1 頁 / 共 2 頁
字號:
// ============================================================================
// Data Structures For Game Programmers
// Ron Penton
// DLinkedList.h
// This is the Doubly-Linked List class
// ============================================================================
#ifndef DLINKEDLIST_H
#define DLINKEDLIST_H




// forward declarations of all the classes in this file
template<class Datatype> class DListNode;
template<class Datatype> class DLinkedList;
template<class Datatype> class DListIterator;



// -------------------------------------------------------
// Name:        DListNode
// Description: This is the Doubly-linked list node class.
// -------------------------------------------------------
template<class Datatype>
class DListNode
{
public:


// ----------------------------------------------------------------
//  Name:           m_data
//  Description:    This is the data in the node.
// ----------------------------------------------------------------
    Datatype m_data;

// ----------------------------------------------------------------
//  Name:           m_next
//  Description:    This is a pointer to the next node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_next;

// ----------------------------------------------------------------
//  Name:           m_previous
//  Description:    This is a pointer to the last node in the list
// ----------------------------------------------------------------
    DListNode<Datatype>* m_previous;


// ----------------------------------------------------------------
//  Name:           DeLink
//  Description:    This delinks this node from the list it is in.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Delink()
    {
        // if a previous node exists, then make the previous
        // node point to the next node.
        if( m_previous != 0 )
            m_previous->m_next = m_next;

        // if the next node exists, then make the next node
        // point to the previous node.
        if( m_next != 0 )
            m_next->m_previous = m_previous;
    }


// ----------------------------------------------------------------
//  Name:           InsertAfter
//  Description:    This adds a node after the current node.
//  Arguments:      p_data - The data to store in the new node.
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertAfter( Datatype p_data )
    {
        // create the new node.
        DListNode<Datatype>* newnode = new DListNode<Datatype>;
        newnode->m_data = p_data;

        // set up newnode's pointers.
        newnode->m_next     = m_next;
        newnode->m_previous = this;

        // if there is a node after this one, make it point to
        // newnode
        if( m_next != 0 )
            m_next->m_previous = newnode;

        // make the current node point to newnode.
        m_next = newnode;
    }


// ----------------------------------------------------------------
//  Name:           InsertBefore
//  Description:    This adds a node before the current node.
//  Arguments:      p_data - The data to store in the new node.
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertBefore( Datatype p_data )
    {
        // create the new node.
        DListNode<Datatype>* newnode = new DListNode<Datatype>;
        newnode->m_data = p_data;

        // set up newnode's pointers.
        newnode->m_next     = this;
        newnode->m_previous = m_previous;

        // if there is a node before this one, make it point to
        // newnode
        if( m_previous != 0 )
            m_previous->m_next = newnode;

        // make the current node point to newnode.
        m_previous = newnode;
    }


};



// -------------------------------------------------------
// Name:        DLinkedList
// Description: This is the Doubly-linked list container.
// -------------------------------------------------------
template<class Datatype>
class DLinkedList
{
public:

// ----------------------------------------------------------------
//  Name:           DLinkedList
//  Description:    Constructor; creates an empty list
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    DLinkedList()
    {
        m_head = 0;
        m_tail = 0;
        m_count = 0;
    }

    
// ----------------------------------------------------------------
//  Name:           DLinkedList
//  Description:    Destructor; destroys every node
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    ~DLinkedList()
    {
        // temporary node pointers.
        DListNode<Datatype>* node = m_head;
        DListNode<Datatype>* next;

        while( node != 0 )
        {
            // save the pointer to the next node.
            next = node->m_next;

            // delete the current node.
            delete node;

            // make the next node the current node.
            node = next;
        }
    }


// ----------------------------------------------------------------
//  Name:           Append
//  Description:    Adds a new node to the end of a list
//  Arguments:      p_data - the data to be added.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Append( Datatype p_data )
    {
        // if there is no head node (ie: list is empty)
        if( m_head == 0 )
        {
            // create a new head node.
            m_head = m_tail = new DListNode<Datatype>;
            m_head->m_data = p_data;
            m_head->m_next = 0;
            m_head->m_previous = 0;
        }
        else
        {
            // insert a new node after the tail, and reset the tail.
            m_tail->InsertAfter( p_data );
            m_tail = m_tail->m_next;
        }
        m_count++;
    }


// ----------------------------------------------------------------
//  Name:           Prepend
//  Description:    Addss a new node to the beginning of a list
//  Arguments:      p_data - the data to be added.
//  Return Value:   None.
// ----------------------------------------------------------------
    void Prepend( Datatype p_data )
    {
        // if there is no head node (ie: list is empty)
        if( m_head == 0 )
        {
            // create a new head node.
            m_head = m_tail = new DListNode<Datatype>;
            m_head->m_data = p_data;
            m_head->m_next = 0;
            m_head->m_previous = 0;
        }
        else
        {
            // insert a new node before the head, and reset the head.
            m_head->InsertBefore( p_data );
            m_head = m_head->m_previous;
        }
        m_count++;
    }


// ----------------------------------------------------------------
//  Name:           RemoveHead
//  Description:    This removes the very first node in the list.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void RemoveHead()
    {
        DListNode<Datatype>* node = 0;

        if( m_head != 0 )
        {
            // make node point to the next node.
            node = m_head->m_next;

            // then delete the head, and make the pointer
            // point to node.
            delete m_head;
            m_head = node;

            // if the head is null, then we've just deleted the only node
            // in the list. set the tail to 0.
            // if not, set the previous pointer to 0.
            if( m_head == 0 )
                m_tail = 0;
            else
                m_head->m_previous = 0;

            m_count--;
        }
    }


// ----------------------------------------------------------------
//  Name:           RemoveTail
//  Description:    This removes the very last node in the list.
//  Arguments:      None.
//  Return Value:   None.
// ----------------------------------------------------------------
    void RemoveTail()
    {
        DListNode<Datatype>* node = 0;

        if( m_tail != 0 )
        {
            // make node point to the next node.
            node = m_tail->m_previous;

            // then delete the head, and make the pointer
            // point to node.
            delete m_tail;
            m_tail = node;

            // if the tail is null, then we've just deleted the only node
            // in the list. set the head to 0.
            // if not, set the next pointer to 0.
            if( m_tail == 0 )
                m_head = 0;
            else
                m_tail->m_next = 0;

            m_count--;
        }
    }



// ----------------------------------------------------------------
//  Name:           InsertAfter
//  Description:    Inserts data after the iterator, or at the end
//                  of the list if iterator is invalid.
//  Arguments:      p_iterator: The iterator to insert after
//                  p_data: the data to insert
//  Return Value:   None.
// ----------------------------------------------------------------
    void InsertAfter( DListIterator<Datatype>& p_iterator, Datatype p_data )
    {
        if( p_iterator.m_node != 0 )
        {
            // insert the data after the iterator
            p_iterator.m_node->InsertAfter( p_data );

            // if the iterator was the tail of the list,
            // reset the tail pointer
            if( p_iterator.m_node == m_tail )
                m_tail = m_tail->m_next;

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


// ----------------------------------------------------------------
//  Name:           InsertBefore
//  Description:    inserts data before the iterator, or prepends
//                  it to the beginning of the list if invalid.
//  Arguments:      p_iterator: The iterator to insert after
//                  p_data: the data to insert
//  Return Value:   None.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合色综合88| 欧美激情在线看| 国产精品99久久久久| 欧美伦理影视网| 日韩va亚洲va欧美va久久| 欧美日韩一区二区在线视频| 午夜精品福利在线| 日韩女优毛片在线| 成人综合在线网站| 亚洲特级片在线| 日韩午夜在线观看视频| 国产一区在线精品| 中文字幕亚洲一区二区va在线| 91污片在线观看| 久久99精品国产.久久久久久| 国产精品午夜免费| 91精品国产品国语在线不卡| 成人深夜福利app| 日韩不卡手机在线v区| 国产女同互慰高潮91漫画| 欧美一区二区网站| 成人美女视频在线看| 中文字幕成人网| 中文字幕字幕中文在线中不卡视频| 日韩视频免费观看高清在线视频| 日韩va欧美va亚洲va久久| 日韩一区二区三| 懂色中文一区二区在线播放| 亚洲福利视频导航| 中文一区一区三区高中清不卡| 色综合久久88色综合天天6| 久久超碰97中文字幕| 亚洲综合网站在线观看| 国产午夜精品久久久久久久 | 欧美一区在线视频| 欧美精品一区二区三区视频| 麻豆精品视频在线观看免费| 亚洲激情图片qvod| 国产日韩欧美在线一区| 久久婷婷国产综合国色天香| 欧美系列一区二区| 老司机午夜精品| 一区二区欧美在线观看| 国产欧美精品国产国产专区| 91精品国产手机| 久久影院午夜片一区| 91在线观看美女| 色一情一伦一子一伦一区| 丁香亚洲综合激情啪啪综合| 国产大片一区二区| 国产精品一区二区在线观看网站 | 亚洲小少妇裸体bbw| 亚洲国产精品久久久久秋霞影院 | 国产精品亚洲一区二区三区在线| 午夜视黄欧洲亚洲| 石原莉奈在线亚洲二区| 久久国产乱子精品免费女| 国内精品国产成人国产三级粉色| 国产麻豆精品theporn| 成人免费视频一区| 日本韩国欧美三级| 日韩一区二区免费在线观看| 欧美日韩精品免费| 久久一留热品黄| 香港成人在线视频| 国产精品你懂的在线欣赏| 久久色成人在线| 亚洲情趣在线观看| 国产精品一区在线观看你懂的| 色老汉av一区二区三区| 日韩视频一区二区三区| 国产精品超碰97尤物18| 日日欢夜夜爽一区| 99久久精品免费看| 欧美tk丨vk视频| 中文字幕亚洲区| 国产伦精品一区二区三区免费迷 | 视频一区二区不卡| 国产成人综合亚洲网站| 欧美美女bb生活片| 亚洲欧洲成人自拍| 99久久精品国产毛片| 日韩午夜精品电影| 午夜精品久久久久久久久久久| 精品一区二区三区在线观看| 91麻豆国产在线观看| 亚洲色欲色欲www在线观看| 国产精品自在在线| 久久天天做天天爱综合色| 亚洲激情综合网| 日本精品视频一区二区| 亚洲欧洲精品一区二区三区不卡 | 在线观看国产91| 亚洲大型综合色站| 在线不卡中文字幕播放| 老司机精品视频导航| 老司机精品视频在线| 亚洲成年人影院| 丁香一区二区三区| 亚洲综合色视频| 日韩欧美亚洲国产精品字幕久久久| 免费xxxx性欧美18vr| 精品国产第一区二区三区观看体验| 黄色精品一二区| 国产精品九色蝌蚪自拍| 国产v日产∨综合v精品视频| 欧美成人一区二区| 国产一区二区三区视频在线播放| 亚洲国产精品精华液ab| 一本大道久久a久久精品综合 | 欧美日本在线一区| 国产成人精品一区二| 亚洲超丰满肉感bbw| 2022国产精品视频| 成人午夜视频免费看| 日本一区二区三区在线观看| 欧美日精品一区视频| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 国产精品毛片久久久久久久| 欧美高清性hdvideosex| 国产精品中文字幕日韩精品| 日韩在线一区二区三区| 国产精品动漫网站| 国产精品网站一区| 亚洲色图在线播放| 日韩午夜在线观看| 成人听书哪个软件好| 天天综合色天天综合色h| 成人黄动漫网站免费app| 亚洲一区自拍偷拍| 亚洲区小说区图片区qvod| 中文字幕日韩一区| 最新热久久免费视频| 亚洲色图清纯唯美| 亚洲一区在线看| 日本视频在线一区| 国产精品中文字幕欧美| 成人永久免费视频| 久久亚洲免费视频| 国产三级三级三级精品8ⅰ区| 国产精品久久久久毛片软件| 一区二区在线观看免费视频播放| 亚洲国产成人高清精品| 九九视频精品免费| 不卡一区二区三区四区| 欧美在线高清视频| 26uuu亚洲婷婷狠狠天堂| 国产精品久久久久永久免费观看| 亚洲在线视频网站| 国内精品久久久久影院薰衣草 | 亚洲天堂精品视频| 亚洲图片欧美视频| 国产一区二区三区免费看| 91免费在线视频观看| 777xxx欧美| 亚洲视频一区在线| 美女免费视频一区| 成人免费黄色在线| 91麻豆精品国产自产在线| 欧美国产精品专区| 日本一道高清亚洲日美韩| 成人毛片在线观看| 日韩欧美中文字幕一区| 亚洲色图欧美在线| 国产乱码精品一区二区三区忘忧草 | 在线观看日韩电影| 国产欧美日产一区| 看电视剧不卡顿的网站| 色激情天天射综合网| 久久婷婷国产综合国色天香| 亚洲妇女屁股眼交7| 成人在线视频首页| 久久日韩精品一区二区五区| 不卡区在线中文字幕| 欧美日韩国产综合草草| 中文字幕在线不卡一区 | 91麻豆精品国产91久久久久| 一区在线观看视频| 国产精品12区| 欧美电影免费提供在线观看| 亚洲图片欧美视频| 色老汉av一区二区三区| 亚洲欧洲精品一区二区三区| 国产一区不卡精品| 亚洲精品一区二区三区在线观看| 亚洲国产wwwccc36天堂| 91黄色激情网站| 亚洲欧美一区二区三区极速播放| 成人午夜视频在线观看| 国产亚洲精品aa午夜观看| 国产麻豆精品一区二区| 精品久久久久一区二区国产| 美女国产一区二区| 制服丝袜亚洲精品中文字幕| 五月天国产精品| 欧美另类一区二区三区| 日韩制服丝袜av| 欧美一卡2卡3卡4卡| 久久se精品一区二区| 26uuu久久天堂性欧美|