File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* ******************************************************************************
2
+ * DANIEL'S ALGORITHM IMPLEMENTAIONS
3
+ *
4
+ * /\ | _ _ ._ o _|_ |_ ._ _ _
5
+ * /--\ | (_| (_) | | |_ | | | | | _>
6
+ * _|
7
+ *
8
+ * FIBONACCI HEAP
9
+ *
10
+ * In computer science, a Fibonacci heap is a heap data structure consisting of
11
+ * a collection of trees. It has a better amortized running time than a binomial
12
+ * heap. Fibonacci heaps were developed by Michael L. Fredman and Robert E. Tarjan
13
+ * in 1984 and first published in a scientific journal in 1987. The name of
14
+ * Fibonacci heap comes from Fibonacci numbers which are used in the
15
+ * running time analysis.
16
+ *
17
+ * http://en.wikipedia.org/wiki/Fibonacci_heap
18
+ ******************************************************************************/
19
+
20
+ #ifndef __FIB_HEAP_H__
21
+ #define __FIB_HEAP_H__
22
+ #include < stdint.h>
23
+ namespace alg {
24
+ template <typename _Key,typename _Val>
25
+ class FibHeap {
26
+ public:
27
+ typedef _Key key_type;
28
+ typedef _Val value_type;
29
+ typedef struct node_t {
30
+ int32_t degree;
31
+ node_t * parent;
32
+ node_t * child;
33
+ bool mark;
34
+ key_type key;
35
+ value_type value;
36
+ } *Node;
37
+ private:
38
+ FibHeap (const FibHeap &);
39
+ FibHeap& operator =(const FibHeap&);
40
+ private:
41
+ int32_t n;
42
+ Node min;
43
+ public:
44
+ FibHeap () {
45
+ }
46
+ };
47
+ }
48
+
49
+ #endif //
You can’t perform that action at this time.
0 commit comments