ALLInterview.com :: Home Page            
 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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
   
 
Categories  >>  Software  >>  Operating Systems  >>  Data Structures
 
 


 

 
 Windows interview questions  Windows Interview Questions
 Linux interview questions  Linux Interview Questions
 Unix interview questions  Unix Interview Questions
 Solaris interview questions  Solaris Interview Questions
 RTOS interview questions  RTOS Interview Questions
 Bulnex interview questions  Bulnex Interview Questions
 Operating Systems General Concepts interview questions  Operating Systems General Concepts Interview Questions
 Data Structures interview questions  Data Structures Interview Questions
 Operating Systems AllOther interview questions  Operating Systems AllOther Interview Questions
Question
A list is ordered from smaller to largest when a sort is
called. Which sort would take the longest time to execute?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 1
I am not sure about the answer.

But I think the answer is "Selection Sort" whose order is
O(n^2) irrespective of the elements order.

I guess all other sorts somehow depend on the order of elements.
 
Is This Answer Correct ?    1 Yes 5 No
Ntrphanikumar
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 2
Its Quick Sort !!!!!
Even I got Surpriced!!!


http://www.geocities.com/siliconvalley/network/1854/Sort1.
html
 
Is This Answer Correct ?    12 Yes 2 No
Udkl
 
 
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 3
selection sort. 
Is This Answer Correct ?    3 Yes 7 No
Punit
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 4
selection sort,quick sort,bubble sort
(all will take the same time and its time complexity is of
the order of n^2)
the time complexity for insertion sort when the list is
ordered from smaller to larger is O(n)
the time complexity for merge sort irrespective of the
order of the elements is O(nlogn)
 
Is This Answer Correct ?    14 Yes 1 No
Uma Sankar Pradhan
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 5
The Time Complexity of Bubble sort,insertion sort and
selection sort is same i.e. O(n^2). So all sorting
algorithms will take same time to sort the elements.
Please correct me if im wrong..
 
Is This Answer Correct ?    1 Yes 7 No
Manasi
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 6
Quick sort's worst case is the one given in the question.
It exhibits selection sort type of procedure when the list
is sorted

Hence both :)
 
Is This Answer Correct ?    7 Yes 0 No
Vinoth Kumar.r
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 7
quick sort is the answer.....quick sort shows worst case
behaviour when the list is already sorted....

courtesy"" shaum series- data structures""
 
Is This Answer Correct ?    10 Yes 0 No
Zeeshan
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 8
bubble sort 
Is This Answer Correct ?    1 Yes 2 No
Siya
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 9
Quict Sort 
Is This Answer Correct ?    2 Yes 0 No
Santosh
 
  Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
Answer
# 10
Its Quick Sort 
Is This Answer Correct ?    3 Yes 0 No
Neha Gundecha
 

 
 
 
Other Data Structures Interview Questions
 
  Question Asked @ Answers
 
Stack can be described as a pointer. Explain. Wipro4
What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack and Tail Recursion? TCS2
Parenthesis are never needed in prefix or postfix expressions. Why? Microsoft11
Which sort show the best average behavior?  9
sir plz. send me a bunch of questions related to this topic which may help me in campus selection ABC1
applications of stacks and their uses? Samsung1
ple.. briefly describe the purpose of having a base case and a recursive case in a recursive algorithm  2
What is a data structure? Keane-India-Ltd12
What is binary tree? BMC13
what is binary tree? BMC12
input function and output function in c language Tcs2
1) Program A and B are analyzed and found to have worst- case running times no greater than 150nlog2n and n2 respectively.Answer the folloWing questions if possible.. i) which program has the better guarantee on the running time,for larger values of n(n>10000) ? ii) which program has the better guarantee on the running time,for small values of n(n<100) ? iii) which program will run faster on average for n =1000 2) wRite a program to compute the number of collisions required in a long random sequence of insertions using linear probing ,quadratic probing and double hashing 3) what is the optimal way to compute A1 A2 A3 A4 A5 A6 where the dimensions of the matrices are A1:10*20 A2 : 20 * 1 A3 : 1 * 40 A4 : 40*5 A5 : 5 * 30 A6 : 30 X 15 KPIT3
 
For more Data Structures 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 © 2012  ALLInterview.com.  All Rights Reserved.

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