-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHighLabelQueue.h
More file actions
56 lines (49 loc) · 1.2 KB
/
HighLabelQueue.h
File metadata and controls
56 lines (49 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
#include "NodePool.h"
#include <queue>
//The HighLabelQueue implements a priority queue as described in the article
//It holds an array of doubly linked lists, and an index to the array indicating
//the place of the list with the highest labels
class HighLabelQueue : public NodePool
{
protected:
//
//the list node sub-class
//
class ListNode
{
public:
Node* node; //value stored in the node
ListNode *next; //pointer to next node
ListNode *prev; //pointer to previous node
};
//
//the doubly linked list sub-class
//
class DList
{
public:
ListNode *front; //pointer to front of list
ListNode *back; //pointer to back of list
DList()
{
front=NULL;
back=NULL;
}
void insertFront(Node* node);
void insertBack(Node* node);
Node* removeFront();
void insertBefore(Node* node,ListNode *nodeB);
};
//End of the doubly linked list sub-class
public:
HighLabelQueue(int node_num);
HighLabelQueue(void);
~HighLabelQueue(void);
void findNewPtr();
void addNode(Node* node);
Node* getNode();
protected:
DList* listArray;
int arrayPtr;
};