4

Can anyone point me to some good Java library (jar) that has some more data structures other than what comes as part of standard Java language. I want support for things like - Tuple, Pair, Tries, Binomial/Fibonacci trees and may be Graphs. [Yes, I know writing them on my own will be lot of fun, but I am reluctant to reinvent the wheel right now]

user396089
  • 1,115
  • 1
  • 12
  • 26
  • 2
    Check this post with discussions on various thirdparty libraries: http://stackoverflow.com/questions/629804/what-is-the-most-efficient-java-collections-library/630864#630864 – emt14 Oct 29 '11 at 10:25

3 Answers3

5

I am not aware of any single Java library that contains all of those components. There is however a very good library called JGraphT which provides a very nice and comprehensive API for graphs in Java. It also includes some structures that are related to that such as a FibonacciHeap class. They also have a very comprehensive JavaDoc. The feature list from the JGraphT website lists:

  • directed and undirected graphs.
  • graphs with weighted / unweighted / labeled or any user-defined edges.
  • various edge multiplicity options, including: simple-graphs, multigraphs, pseudographs.
  • unmodifiable graphs - allow modules to provide "read-only" access to internal graphs.
  • listenable graphs - allow external listeners to track modification events.
  • subgraphs graphs that are auto-updating subgraph views on other graphs.
  • all compositions of above graphs.
Jiddo
  • 1,256
  • 1
  • 10
  • 15
4

The prefuse library/framework has most (all? maybe not pair) of those, even though it's a visualization library (and a really nice one at that).

Dave Newton
  • 158,873
  • 26
  • 254
  • 302
  • This seems more like a visualization library. I was more searching for an Algorithm/Data Structure library - something similar to Boost libraries in C++! Thanks anyway. – user396089 Oct 29 '11 at 08:59
  • @user396089 That's because that's what it is (and I said as much). I wasn't aware that *where* the classes were mattered to you, I assumed you were just interested in having the classes. How does it matter? – Dave Newton Oct 29 '11 at 14:25
3

Guava has a number of additional data structures, as well as the Apache Commons Collections library.

cdeszaq
  • 30,869
  • 25
  • 117
  • 173