Which are the sorted collections?



Which are the sorted collections?..

Answer / Sandeep Anannd

In Java, the following collections can maintain their elements in sorted order:n
1. TreeMap: A Red-Black tree implementation of the SortedMap interface.n
2. LinkedHashMap (when sorted by insertion order): Provides access to elements in the order they were inserted into the map.n
3. TimSort: The default sorting algorithm used for ArrayList and Vector, which is a hybrid sorting algorithm combining Mergesort and Insertionsort.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Why hashtable is faster than arraylist?

1 Answers  


Can we change the size of an array at run time?

1 Answers  


Which time complexity is best?

1 Answers  


Program to remove duplicate elements in an array.

1 Answers   InterGraph,


What are the different types of data type?

1 Answers  


Define static data structures?

1 Answers  


Can map contain duplicate keys?

1 Answers  


Explain Queue

1 Answers   Tech Mahindra,


Explain the term tail recursion?

1 Answers  


What do u mean by array?

1 Answers  


How memory is reserved using a declaration statement in data structure?

1 Answers  


Run time memory allocation is known as in data structure?

1 Answers  


Categories