NAMD
Main Page
Namespaces
Classes
Files
File List
File Members
heap.h
Go to the documentation of this file.
1
7
#include "
elements.h
"
8
9
class
heapRecord
10
{
public
:
11
short
deleted
;
// boolean
12
InfoRecord
*
info
;
13
};
14
15
class
heapIterator
{
16
public
:
17
int
next
;
18
};
19
20
class
minHeap
21
{
22
private
:
23
heapRecord
*h;
24
int
count;
25
int
size;
26
void
swap(
int
i,
int
j)
27
{
28
heapRecord
temp = h[i];
29
h[i] = h[j];
30
h[j] = temp;
31
}
32
33
public
:
34
minHeap
(
int
size);
35
~minHeap
();
36
int
numElements
();
37
int
insert
(
InfoRecord
*);
38
InfoRecord
*
deleteMin
();
39
InfoRecord
*
iterator
(
heapIterator
*);
40
InfoRecord
*
next
(
heapIterator
*);
41
};
42
43
class
maxHeap
44
{
45
private
:
46
heapRecord
*h;
47
int
count;
48
int
size;
49
50
void
swap(
int
i,
int
j)
51
{
52
heapRecord
temp = h[i];
53
h[i] = h[j];
54
h[j] = temp;
55
}
56
57
public
:
58
maxHeap
(
int
size);
59
~maxHeap
();
60
int
numElements
();
61
int
insert
(
InfoRecord
*);
62
InfoRecord
*
deleteMax
();
63
InfoRecord
*
iterator
(
heapIterator
*);
64
InfoRecord
*
next
(
heapIterator
*);
65
};
66
minHeap
Definition:
heap.h:20
InfoRecord
Definition:
elements.h:13
minHeap::~minHeap
~minHeap()
Definition:
heap.C:21
minHeap::insert
int insert(InfoRecord *)
Definition:
heap.C:30
maxHeap::numElements
int numElements()
Definition:
heap.C:121
maxHeap::maxHeap
maxHeap(int size)
Definition:
heap.C:110
elements.h
maxHeap::next
InfoRecord * next(heapIterator *)
Definition:
heap.C:196
minHeap::next
InfoRecord * next(heapIterator *)
Definition:
heap.C:100
heapRecord
Definition:
heap.h:9
maxHeap::deleteMax
InfoRecord * deleteMax()
Definition:
heap.C:152
maxHeap
Definition:
heap.h:43
maxHeap::~maxHeap
~maxHeap()
Definition:
heap.C:117
heapIterator::next
int next
Definition:
heap.h:17
maxHeap::insert
int insert(InfoRecord *)
Definition:
heap.C:126
minHeap::iterator
InfoRecord * iterator(heapIterator *)
Definition:
heap.C:94
heapIterator
Definition:
heap.h:15
heapRecord::deleted
short deleted
Definition:
heap.h:11
minHeap::numElements
int numElements()
Definition:
heap.C:25
minHeap::minHeap
minHeap(int size)
Definition:
heap.C:14
heapRecord::info
InfoRecord * info
Definition:
heap.h:12
minHeap::deleteMin
InfoRecord * deleteMin()
Definition:
heap.C:57
maxHeap::iterator
InfoRecord * iterator(heapIterator *)
Definition:
heap.C:189
Generated by
1.8.5