dllist.h
来自「nachos下的并发程序设计」· C头文件 代码 · 共 38 行
H
38 行
//#include <iostream>
class DLLElement {
public:
DLLElement( void *itemPtr, int sortKey);
DLLElement *next;
DLLElement *prior; //双向链表有两个指针
int key;
void *item;
};
class DLList {
public:
DLList(); // initialize the list
~DLList(); // de-allocate the list
void Prepend(void *item); // Put item at the beginning of the list
void Append(void *item); // Put item at the end of the list
void *Remove(int *keyPtr); // Take item off the front of the list
bool IsEmpty(); // is the list empty?
void SortedInsert(void *item, int sortKey); // Put item into list
void *SortedRemove(int sortkey); // Remove first item from list
private:
DLLElement *first; // Head of the list, NULL if list is empty
DLLElement *last; // Last element of list
};
void ListInsert(int N, DLList *List);
void ListRemove(int N, DLList *List);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?