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

Can a static class have a constructor java?

0 Answers  


How are destructors defined in java?

0 Answers  


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

0 Answers  


How do you create a first line indent?

0 Answers  


What does string mean in java?

0 Answers  






What are the 6 boolean operators?

0 Answers  


What is the final access modifier in java?

0 Answers  


What is mean by encoding?

0 Answers  


What are the different types of collections in java?

0 Answers  


Which is faster string or stringbuilder?

0 Answers  


Where is the singleton class used?

0 Answers   Cap Gemini,


What are the differences between include directive and include action?

0 Answers  


Categories