Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
 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

 Categories  >>  Software  >>  Operating Systems  >>  Data Structures

 Windows Interview Questions Linux Interview Questions Unix Interview Questions Solaris Interview Questions RTOS Interview Questions Bulnex Interview Questions Operating Systems General Concepts Interview Questions Data Structures 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?
# 1

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?
# 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?
# 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?
# 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

Re: A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
# 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?
# 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?
# 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?
# 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?
# 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?
# 10
Its Quick Sort
 Is This Answer Correct ? 3 Yes 0 No
Neha Gundecha

  Question Asked @ Answers Other Data Structures Interview Questions Stack can be described as a pointer. Explain. Wipro 4 What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack and Tail Recursion? TCS 2 Parenthesis are never needed in prefix or postfix expressions. Why? Microsoft 11 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 ABC 1 applications of stacks and their uses? Samsung 1 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-Ltd 12 What is binary tree? BMC 13 what is binary tree? BMC 12 input function and output function in c language Tcs 2 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 KPIT 3 For more Data Structures Interview Questions Click Here