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

📄 dllist.h

📁 程序使用的是在nachos体系架构下完成双向链表的构建
💻 H
字号:
#ifndef DLLIST_H#define DLLIST_H#include"copyright.h"#include"utility.h"class DLListElement {   public:     DLListElement(void *itemPtr, int sortKey);	// initialize a list element     DLListElement *next;		// next element on list, 				// NULL if this is the last     DLListElement *prev;       // previous element on list                                // NULL if this is the first     int key;		    	// priority, for a sorted list     void *item; 	    	// pointer to item on the list};class DLList {  public:    DLList();			// initialize the list    ~DLList();			// de-allocate the list    void Prepend(void *item); 	// add to head of list     void Append(void *item); 	// add to tail of list     void *Remove(int *keyPtr); 	// remove from head of list                                // set *keyPtr to key of the removed item                                // return item (or NULL if list is empty)          bool IsEmpty();		// return true if list has no element        // Routines to put/get items on/off list in order (sorted by key)    void SortedInsert(void *item, int sortKey);	    void *SortedRemove(int *keyPtr); 	  // remove first item    void Print();  private:    DLListElement *first;  	// Head of the list, NULL if list is empty    DLListElement *last;	// Last element of list,NULL if empty};#endif

⌨️ 快捷键说明

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