Question: > 
> **Possible Duplicate:**  
> 
> [Java tree data-structure?](https://stackoverflow.com/questions/3522454/java-tree-data-structure) 
> 
> 
> 

Is there any Java data structure implementation similar to tree and graph?

Answer: 
Not in the `java.util` Collections API.

You can use the [DefaultTreeModel](http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/tree/DefaultTreeModel.html) from Swing for trees.

[Jung](http://jung.sourceforge.net/) is a graph framework.
As I [answered for a similar question](https://stackoverflow.com/questions/4978487/why-java-collection-framework-doesnt-contain-tree-and-graph/4979522#4979522), the Java API contains no general API for trees/graphs, since there is no unique set of features needed in every usecase. There are quite some tree/graph-like APIs for special cases, though.

And in principle it is easy to make your own graph - one could even say that every object is in fact a node in a graph, with the values of its reference type fields being the (outgoing) neighbors.