📄 dllist.h
字号:
//#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -