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 r advatages of websphere? & how to deploy?

0 Answers   Saksoft,


From the two, which would be easier to write: synchronization code for ten threads or two threads?

0 Answers  


what is method reference in java 8?

0 Answers  


What are white spaces in java?

0 Answers  


What is the difference between pass by reference and pass by pointer?

0 Answers  






What is volatile keyword in java

0 Answers  


why constructor dont have returns type?

9 Answers   IBM,


What is meant by serialisation and deserialisation?

4 Answers  


Features of JAVA ? In which version of java synchronizedXXX() methods are included in Collections class.

1 Answers   NIIT,


Explain about map interface in java?

0 Answers  


What is the difference between DataInputStream and BufferedReader

2 Answers   Hexagon,


How many types of variables are there?

0 Answers  


Categories