Is there a standard Java implementation of a Fibonacci heap?

前端 未结 3 686
無奈伤痛
無奈伤痛 2020-12-07 19:00

I was looking at the different kind of heap data structures.

The Fibonacci heap seems to have the better worst case complexity for (1) insertion, (2) deletion and (

3条回答
  •  被撕碎了的回忆
    2020-12-07 19:34

    But why they did not use a Fibonacci heap?

    Probably because those heaps have a lot more overhead per entry than binary keys.

    Also, is there an implementation of Fibonacci heap in Java.util?

    No, but

    1. There is graphmaker from Nathan Fiedler - GPL and with good test coverage, but have a look into this nice blog post about it and about problems a fibonacci impl can have. In this post a lot of other Java implementions are referenced.
    2. There is some code with unit tests here
    3. The JGraphT project (also Nathan Fiedler) and also with (some minor) tests but LGPL.
    4. Last but not least there is Neo4j - GPL - no tests.

提交回复
热议问题