-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFibonacciHeap.h
More file actions
58 lines (47 loc) · 1.18 KB
/
Copy pathFibonacciHeap.h
File metadata and controls
58 lines (47 loc) · 1.18 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
57
58
//
// Created by h2279 on 2018/04/03.
//
#ifndef SHORTESTPATHALGORITHMWITHHEAPS_PRIORITY_HEAP_H
#define SHORTESTPATHALGORITHMWITHHEAPS_PRIORITY_HEAP_H
#include "fibonacci_heap.h"
#include "Heap.h"
using namespace std;
/**
* a class extends Heap which implements Push,Pop,Top,Empty,Clear functions
* it use fibonacci heap data structure
*/
class FibonacciHeap : public Heap {
private:
// private struct to store the element
FibHeap fibHeap;
public:
/**
* default constructor
*/
FibonacciHeap();
/**
* create a Pair<int,Type>, and create a node, and insert it into fibonacci heap
* @param index
* @param key
*/
void push(int index, Type key) override;
/**
* pop the root node,without return
*/
void pop() override;
/**
* return the top node's key and index. It will not pop the root node.
* @return
*/
pair<int, Type> top() override;
/**
* check whether the heap is empty, if so, return true, else false
* @return
*/
bool empty() override;
/**
* clear all the data in the heap
*/
void clear() override;
};
#endif //SHORTESTPATHALGORITHMWITHHEAPS_PRIORITY_HEAP_H