answersLogoWhite

0

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

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the difference between a hash set and a linked hash set?

The only difference is that the LinkedHashSet maintains the order of the items added to the Set but HashSet doesn't maintain any order.


Difference between HashSet and Linkedhash set in java?

The only difference is that the LinkedHashSet maintains the order of the items added to the Set. It does this by maintaining a doubly linked list containing the hash and the original order of the items. According to Sun, the LinkedHashSet should run nearly as fast as the HashSet.LinkedHashSet A LinkedHashSet is an ordered version of HashSet thatmaintains a doubly-linked List across all elements. Use this class instead of HashSetwhen you care about the iteration order. When you iterate through a HashSet theorder is unpredictable, while a LinkedHashSet lets you iterate through the elementsin the order in which they were inserted.HashSet A HashSet is an unsorted, unordered Set. It uses the hashcodeof the object being inserted, so the more efficient your hashCode() implementationthe better access performance you'll get. Use this class when you want a collectionwith no duplicates and you don't care about order when you iterate through it.


What is the lookup time for a hashset data structure?

The lookup time for a HashSet data structure is typically O(1), which means it is constant time and does not depend on the number of elements in the set.


What is a difference between a collection and a set?

None. A set is a collection and a collection is a set.


What is the difference between two sets in Python?

In Python, the difference between two sets is the elements that are present in one set but not in the other set.


What is the difference between a system of numerals and a set of numbers?

there is a huge difference. :)


What is the difference between the greatest and least numbers in the set of data is called?

The difference between the greatest and least numbers in a set of data is called the range.


What is the difference between the greatest and least numbers in a set of data?

The difference between the largest and smallest numbers in a data set is called the range.


What is the difference between universal set and substance set?

utterance or diffutterance what is a utterance


What is the difference between the set of whole numbers and the set of natural numbers?

people


What is the difference between a trap set and a drum set?

drum set is something u play


What is the difference between the greater number and the least number?

In a set of numbers, the difference between the greatest and the least is called the range.