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

📄 d_dnode.h

📁 数据结构c++语言描述stl版 威廉兄弟的好书,值得看,这是配书代码
💻 H
字号:
#ifndef DOUBLY_LINKED_NODE_CLASS
#define DOUBLY_LINKED_NODE_CLASS

template <typename T>
class dnode
{
	public:
		// the members of a dnode object are used for operations within a
		// doubly linked list; access is simplified by making them public

      T nodeValue;		// data value of the node
		dnode<T> *prev;	// previous node in the list
      dnode<T> *next;	// next node in the list

		// default constructor. creates object with value T(), the
		// default value of type T. set the node pointers to point at
		// the node itself
      dnode()
		{
			next = this;	// the next node is the current node
			prev = this;	// the previous node is the current node
		}

      // constructor with an argument to initialize nodeValue.
		// set the node pointers to point at the node itself
      dnode(const T& value): nodeValue(value)
		{
			next = this;	// the next node is the current node
			prev = this;	// the previous node is the current node
		}
};

#endif	// DOUBLY_LINKED_NODE_CLASS

⌨️ 快捷键说明

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