-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHeap.h
63 lines (36 loc) · 797 Bytes
/
Heap.h
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
57
58
59
60
61
62
63
#ifndef _HEAP_H
#define _HEAP_H
#include <stdlib.h>
#include "Node.h"
#include "Vertex.h"
class Heap{
private:
Node* root;
int size;
public:
Heap( );
~Heap();
static int getHeight( int x );
int getSize();
void dump();
void setRoot(Node *);
// void swapNode2( Node* a, Node* b );
void swapNode( Node* a, Node* b );
void push( Node* novo );
Node* insert( Node* novo, Node* current );
Node* getRoot();
void dumpin( Node* no );
Node* pop();
Node* top();
void clear( Node* mynode );
void clear( );
void fixUp( Node* mynode );
void fixDown( Node* mynode );
Node* findLast( Node* mynode );
Node* findLast( );
void updateKeyValue( Node*, int );
double getValue( int index );
void updateParent( Node*, Vertex* );
Node* getNode( int index );
};
#endif