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 |
Write a function for palindrome and factorial and explain?
0 Answers Honeywell, Huawei, Zomato,
What are the kinds of polymorphism?
What languages are pass by reference?
Create a form of user Login in JSP, that accepts the user name and password from user and authenticate it with user names and passwords stored in database. (Plz provide me answer immediately)
Which collection is best for sorting in java?
Is java call by value?
What is thread life cycle in java?
What is the purpose of the File class?
How many bits is a double?
Can we override compareto method?
What is the difference between a Window and a Frame?
How we can make copy of a java object?