⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hdbliter.h

📁 数据结构c++语言描述 Borland C++实现
💻 H
字号:

// iterator for doubly-linked circular lists
// with a head node

#ifndef HDoubleCircularIterator_
#define HDoubleCircularIterator_


template<class T>
class HDoubleCircularIterator {
   public:
      T* Initialize(const HDoubleCircular<T>& c)
            {location = c.head->right;
             head = c.head;
             if (location == head) return 0;
             else return &location->data;
             }
      T* Next()
             {if (location->right == head)
                 // no more elements
                 return 0;
             location = location->right;
             return &location->data;
             }
   private:
      DoubleNode<T> *location,  // current element
                    *head;      // head node
};
 
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -