If I have 1000 objects and my requirement is to sort them
quickly, then which collection would you recommend and why?

Answers were Sorted based on User's Feedback



If I have 1000 objects and my requirement is to sort them quickly, then which collection would you ..

Answer / ashutosh dhar

sorted set, already sorted.

Is This Answer Correct ?    3 Yes 0 No

If I have 1000 objects and my requirement is to sort them quickly, then which collection would you ..

Answer / sanjay

The question is about collection and not about the algorithm - My answer is array or arrayList. arraylist is backed by an array so it will have identical performance to an array.

Is This Answer Correct ?    1 Yes 1 No

If I have 1000 objects and my requirement is to sort them quickly, then which collection would you ..

Answer / shankar

quick.it has the least time complexity and with the help
of pivot elements it gets sorted vvery easily.the time
complexity is log2n

Is This Answer Correct ?    2 Yes 3 No

If I have 1000 objects and my requirement is to sort them quickly, then which collection would you ..

Answer / sanjay

ArrayList. indexing is easy, count of objects is already known.

Is This Answer Correct ?    0 Yes 3 No

If I have 1000 objects and my requirement is to sort them quickly, then which collection would you ..

Answer / muni sankar

Heapsort is one of the best general-purpose sorting
algorithms, a comparison sort and part of the selection sort
family. Although somewhat slower in practice on most
machines than a good implementation of quicksort, it has the
advantages of worst-case O(n log n) runtime and being an
in-place algorithm

Is This Answer Correct ?    0 Yes 8 No

Post New Answer

More Core Java Interview Questions

What's the difference between an abstract class and interface in java?

0 Answers  


What are the types of exceptions?

0 Answers  


What is java util collection?

0 Answers  


What Method and class used for Connection pooling ?

5 Answers   TCS, Wipro,


What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky

6 Answers   Accenture, EDS,






What do you understand by java?

0 Answers  


what is the logic inside any default constuctor?

2 Answers  


There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.

3 Answers  


What is a line break example?

0 Answers  


Explain in detail about encapsulation with an example?

4 Answers  


Why collection doesn’t extend cloneable and serializable interfaces?

0 Answers  


Differentiate constructor and a method and how are it be used?

7 Answers   Wipro,


Categories