You need to sign in to do that
Don't have an account?

why is list ordered and map/set are unordered
why is list ordered and map/set are unordered??
can someone explain in detail.i know that list is ordered and set is unordered
can someone explain in detail.i know that list is ordered and set is unordered
A sorted/unordered collection means that not only does the collection have order, but the order depends on the value of the element. A SortedSet is an example.
In contrast, a collection without any order can maintain the elements in any order. A Set is an example.
If that answers your query, please mark this as the best answer
i know the difference between ordered and unordered..but my question is why is MAP an unordered collection and list is ordered collection???
A set/map is an unordered collection.
Elements in a set are not stored in a specific order and you cannot access an element using an index