Can anybody give me a complete list of data structure supported in Java(not in util package)?
I want to know what kinds of data structure in Java and not in开发者_JAVA百科 the util package?
For example: Hashmap, Collection, Set.
Please give me a list of them as many as possible.
Thank you
OK, let me change a way to ask something:
Except in util package, is there any data structures already implemented in JAVA, and if need to use them, we could import them into our class, without constructing by ourselves.
It is not possible to create such a list; Java lets you define your own arbitrary structures.
Sure, http://java.sun.com/javase/6/docs/api/ (ignore java.util). Then add in any user defined data types.
Are you asking specifically about actual implementations or just interfaces? Because 2 of the examples you listed are interfaces and the one that isn't is in java.util. As @crazyscot said java lets you define your own data structures so unless you have something specific in mind it's not really possible to answer your question.
Spend a few day studying the Java collections API.
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html
Most data structures you would need are there. Java 5 added concurrentHashMap and a few better preforming concurrent data structures.
Realistically, you should not need to make your own data structures. If you find yourself rolling your own linked list or something, you are missing something in the Collections API. For more complicated data structures, you can usually piece it together out of other parts of the Collections API.
精彩评论