Why is there no Fibonacci heap implementation in the Standard Java API?
-
Given the fact that Fibonacci heap provides better performance than PriorityQueue (http://en.wikipedia.org/wiki/Fibonacci_heap), why is there no Fibonacci class in Standard Java API ?
-
Answer:
Fibonacci heaps are asymptotically faster than binary and binomial heaps, but this does not necessarily mean they are faster in practice. The additional complexity of Fibonacci heaps will likely make them slower for operations on smaller heaps. Additionally, the delete operation has worse worst case complexity. Many applications simply don't need the additional benefit of a Fibonacci heap and adding it bloats the size of the Java standard library for everyone. If your application really does need one, there are non-standard library implementations. People working on the standard library have other priorities to work on. The Java standard library is already very large and I expect takes quite a bit of effort to maintain. Every class they write adds to this burden.
Tim Wilson at Quora Visit the source
Other answers
To add to point #3 of - the PriorityQueue came along with JSR 166 Concurrency Utilities. This is based on Dr. Doug Lea's Java concurrent work which dates back to 1998 - http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
Miguel Paraz
I know there is no Fibonacci heap in the standard Java API, but there are a few open-source ones. I did some experiment using Fibonacci heap based Priority Queue for the Dijkstra's algorithm. You can see how these open-source implementations perform during the execution of the algorithm. Here is the link for my blog post "https://gabormakrai.wordpress.com/2015/02/11/experimenting-with-dijkstras-algorithm/" and for the experiment's GitHub page "https://github.com/gabormakrai/dijkstra-performance".
Gábor Makrai
Related Q & A:
- Why the same font in Java looks different?Best solution by Stack Overflow
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- Why cannot we use static keyword inside a method in java?Best solution by Stack Overflow
- Is it possible to access the Mac address book API from pure Java?Best solution by Stack Overflow
- Why is Blue the standard ink color for pens?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.