answersLogoWhite

0

TreeSet internally implements Balanced Tree Structure whereas TreeMap implements Red Hat Tree Data Structure.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is a tree set?

A TreeSet is simply an implementation of the AbstractSet abstract class using a TreeMap to back the data. This is an ordered Set implementation with log(n) time cost to access or modify the data.


What is difference between tree set hashset?

Hashset is not allow duplication, order element TreeSet is allow sorted order and not allow duplication HashSet store any type object but Treeset can store only one type( its following type safe mechanisam String or Integer) Hashset faster than TreeSet because elemnts aor store in hash alogirthm


What is the difference between a treeset and hashset in Java?

The difference between these two sets is simply the order/algorithm in which items are added to/accessed/removed from the map. The circumstances determine which particular implementation is better/faster. A treeSet organizes data in a tree through use of Comparator (natural ordering) and the hashSet organizes data in a hash table (using a hash function). See the Java API for more info: http://www.j2ee.me/javase/6/docs/api/java/util/TreeSet.html http://java.sun.com/javase/6/docs/api/java/util/HashSet.html The previous answer (unless I'm mistaken) is pretty much completely wrong... ----------- Previous Answer --------- In a treeset data are placed in order... while in a hashset data is randomly placed... A treeset is more efficient in case of search element. As hashSet use the hash function to store the values, it does not maintain the order of elements, but TreeSet maintains the natural odering of elements (you don't need to sort it).


How do you draw a treemap?

draw a doodle of the thing and try and try again.


What is difference between as on and as at?

difference between as on and as at


What is treemap in java?

A TreeMap is a class in the java.util package that implements the Map data structure - that is, it associates certain keys with their respective values. It stores the key-value pairs in a tree, which means that the keys must implement the Comparable interface. The put() and get() methods are used to manipulate the elements in the map. HashMap is another class in the java.util package that implements a Map, but it uses hashes to store the key-value pairs.


Why is treemap important to programmers?

Treemaps are important to programmers because they create a visualization of the program. It displays data in a hierarchy using rectangles that are nested inside of each other.


What are the differences between California and Florida?

What is the difference between Florida and California What is the difference between Florida and California


What is the difference between physician and doctor?

what's the difference between physician and doctorwhat's the difference between physician and doctor what's the difference between physician and doctor


What difference between paging?

Difference between paging and what?


What is the difference between difference and difference?

just difference


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd.?

difference between enterprise and corporation