ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
If I have 1000 objects and my requirement is to sort them
quickly, then which collection would you recommend and why?
 Question Submitted By :: Maria
I also faced this Question!!     Rank Answer Posted By  
 
  Re: If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?
Answer
# 1
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 4 No
Muni Sankar
 
  Re: If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?
Answer
# 2
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 ?    0 Yes 0 No
Shankar
 
 
 
  Re: If I have 1000 objects and my requirement is to sort them quickly, then which collection would you recommend and why?
Answer
# 3
ArrayList. indexing is easy, count of objects is already known.
 
Is This Answer Correct ?    0 Yes 0 No
Sanjay
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
What is the order of method invocation in an Applet?  1
When finalize method is called?  3
Howmany classes that package java.applet.* contains? TCS1
what is life cycle of applet?  4
What is parameter tag and what is its use?  1
i need example for java abstraction. where we use abstraction and why we need abstraction. Oracle1
what is the difference between sleep() and Wait()? Accenture4
Java support what type of parameter passing ? Wipro6
Does java support multi dimensional arrays ?  4
what is the difference between equals method and == Professional-Access11
How to sort a vector elements that contains the user define class object? (Note: If Suppose consider, A Student class contain two data members. They are String studentName and int rollNo. I am creating Four objects for this class, each object contains students details like name and roll no. Now i am storing that objects in vector and if i retiving the elements from the vector means then it should be display in sorting order) ProdEx-Technologies2
what is auto boxing UHG1
How will you create the class for the following scenario? Employees under one employee? Bally-Technologies2
what is business delegate? TCS2
Which java.util classes and interfaces support event handling?  2
I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing? KPIT5
whats the life cycle of jsp Satyam10
how can u apply shallow cloning and deep cloning to create object? Yash-Technologies1
What restrictions are placed on method overloading and method overriding?  3
What is difference between Iterator and for loop  4
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com