answersLogoWhite

0

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

User Avatar

Wiki User

∙ 13y 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 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 is difference between as on and as at?

difference between as on and as at


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

Trending Questions
What is person who studies stats called? How do you calculate range in mathformula for range? If the number of customers follows a Poisson distribution with a rate of 5.6 per minute what is the distribution of the time it will take for the next two customers to arrive? Describe the interval you would use for a bar graph from 12 to 39 units? If you were to flip a coin eight times what is the probability of getting heads at least six times? Researchers are studying yield of a crop in two locations The researchers are going to compare two independent 90 percent confidence intervals for the mean yield in each location The probability that? When there are no identifiable trends in a graph it means there is no relationship between the two variables? Is 146 considered a high IQ? What does it mean to substantially increase? What is the difference between a report and a summary? Is pH discrete or continuous? What is the probability of getting no tails on two tosses of a coin? What was the population of Alabama in 1990? How much should a 5'11 14 year old boy weight? How should I construct a confidence interval for the population proportion p with n equals 144 and x equals 82 with a 90 percent confidence level? Is assessing hazards which elements make up the cross matrix comparison to determine a risk level? How do you use synoptophore? What is the probability of getting a heart out of a pack of cards? 0.9999 rounded to nearest thousandth? How many possible outcomes of this spinner is spun twice?