A Fibonacci heap is an implementation of a priority queue that supports amortized O(1) insertion, merge, find-min, and decrease-key, along with amortized O(log n) delete and extract-min. When implemented with a Fibonacci heap, Dijkstra's algorithm and Prim's algorithm can be made to work in O(E + V log V).
Questions tagged [fibonacci-heap]
77 questions
0
votes
1 answer
How to call a class recursively in c++?
Hello this is the code:
template class FibonacciHeap{
public:
class Entry{
public:
// Returns the element represented by this heap entry.
T getValue(){
return mElem;
}
…

Chiray
- 133
- 8
0
votes
1 answer
Applications for fibonacci series in software paradigm
I was in an interview when I was asked about describing the application of Fibonacci series.
I knew Fibonacci series are used in some sort of benchmarking but I could not come up with a real software/computer application . I tried researching about…

Maaz Rehman
- 674
- 1
- 7
- 20
0
votes
1 answer
Using a fibonacci heap, is it possible/easy to represent neighbors aswell as minimum distance
I am trying to devise an implementation of dijkstras with fibonacci heaps. What I am trying to understand is if it is possible to represent, other than the minimum distance in O(logn) (with delete) but the neighbors of any given node? Or does this…

Max
- 4,345
- 8
- 38
- 64
0
votes
1 answer
How do I keep track of nodes in a tree using hash table?
I am trying to implement a Fibonacci Heap and I'm required to keep track of its nodes for subsequent operations.
For the uninitiated, Fibonacci heap can be thought of as an m-degree tree or a collection of trees with a pointer to the maximum node in…

tinkuge
- 97
- 1
- 11
0
votes
0 answers
How do I find 'n' max elements of a fibonacci heap?
Max Fibonacci heaps can have one pointer to the max element of the structure. But how do I find 'n' of these? As in, how do I find the next max element after the current one?
One caveat is that I cannot remove elements from the structure as the…

tinkuge
- 97
- 1
- 11
0
votes
2 answers
Is FibonacciHeap a min-heap? how to find max using FibonacciHeap?
My Java project is to use Max Fibonacci heap to find top nth most popular hashtags.
The record can be like this:
#saturday 5
#sunday 3
#saturday 10
#monday 2
#reading 4
#playing_games 2
3
But Fibonacci heap only have find min function.
What is…

user92322
- 29
- 5
0
votes
1 answer
Why we do Amortized Analysis for Fibonacci Heap?
In Fibonacci heap for all operations analysis are Amortized in nature. Why cant we have normal analysis as in case of Binomial Heap.

Moody
- 111
- 1
0
votes
1 answer
dequeuemin in Fibonacci heaps
I wanted to ask about Fibonacci heaps.
If I have this scenario:
A
|
B
Then, we add two more nodes C and D:
A
|\
B C
|
D
Now we delete B:
A
|
C
|
D
Now we add E and F.
I saw it creates a tree like that:
E
|\
F A
|
C
|
D
But I don't…

Rotem
- 13
- 3
0
votes
1 answer
Can Fibonacci Heap have more than one nodes with equal rank(or value, or key)?
I am studying Fibonacci heap alone, and I came across a question.
I know any nodes can be inserted into Fibonacci heap, but what if the rank(or value, or key) of that new node is equal to the sibling node?
1) For example,
(1) <-minimum root
/ …

Joon. P
- 2,238
- 7
- 26
- 53
0
votes
1 answer
Fibonacci Heap implementation is not working
I have been trying to understand the Fibonacci Heap Implementation code here and trying to test with simple test case which does not seem to work. I inserted 3 nodes and then printed the minimum value each time but the answer is wrong.
public static…

LoL
- 41
- 5
0
votes
2 answers
Is a c++ std::priority_queue the right structure for the dijkstra queue
I don't think a c++ priority queue is the right structure for the dijkstra queue, because it contains no functionality for an easy lookup or deletion of elements.
The right structure would be a fibonacci heap, but there is none in the std…

thi gg
- 1,969
- 2
- 22
- 47
0
votes
1 answer
How to add handle as a class member, where class is used for template of heap?
Consider the simple example:
#include
class MyClass;
struct compare_distances
{
bool operator()(const MyClass* n1, const MyClass* n2) const
{
return n1->distance > n2->distance;
}
};
typedef…
user1569844
0
votes
1 answer
How does Fibonacci heap delay work as long as possible?
I am reading CLRS and came across a line "Fibonacci heaps delay works as long as possible".But what does it actually mean by delaying works and how can that be related to performance.

KKGanguly
- 323
- 3
- 13
0
votes
0 answers
Boost Fibonacci Heap
I was looking at the code of the boost Fibonacci heap, and in many places, I saw a variable called _id of type ID (part of the template) being used like this:get(_id, d), where d is of type T&, where T is part of the template. What is the purpose of…

user2472071
- 767
- 1
- 6
- 11
0
votes
1 answer
Maximum time of Extract-Min - Fibonacci heap
What is the actual maximum time of executing extract-min on n-element Fibonacci heap?
Is it O(D(n) + t(H)), where D(n) = lg*n is the maximum degree of a node in n-element heap and t(H) = O(n) is a number of roots in heap H?
Does this mean that…

Kamil Gosciminski
- 16,547
- 8
- 49
- 72