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
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 |
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 |
Answer / sanjay
ArrayList. indexing is easy, count of objects is already known.
| Is This Answer Correct ? | 0 Yes | 3 No |
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 |
How does multithreading take place on a computer with a single cpu?
How 'java' got its name and what it stands for?
What are the steps that are followed when two computers connect through tcp?
What are the properties of thread?
What are the different http methods?
What is meant by 'bit masking' in java?
What are the parts of methodology?
What are the Memory Allocations available in JavaJava?
Tell me are there implementations for sorting and searching in the java libarary?
Can we serialize static variables in java?
What is integer size in java?
What are the two categories of data types in the java programming language?