📄 dllist.h
字号:
#ifndef DLLIST_INCLUDED
#define DLLIST_INCLUDED
class DLLElement
{
public:
DLLElement(void *itermptr,int sortKey); // initiallize a list element
DLLElement *next; //next element on list, NULL if this is the last
DLLElement *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 the head of the list
void Append(void *item); //add to the tail of the list
void *Remove(int *keyPtr); //remove from the list
bool IsEmpty(); // return true if the list has no element
void SortedInsert(void *item, int sortKey); //put items on list in order
void *SortedRemove(int sortKey); // remove first item with key==sortKey return NULL if no such item
private:
DLLElement *first; //head of the list , null if empty
DLLElement *last; //tail of the list ,null if empty
};
extern void ListInsert(int n,DLList *list,int t_num); //insert n elements to the list
extern void ListRemove(int n,DLList *list,int t_num); //remove n elements to the list
extern int Thread_num,Node_num,Flag;
//extern Thread* currentThread;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -