Which of the following sorts is quickest when sorting the
following set: 1 2 3 5 4




1) Quick Sort


2) Bubble Sort


3) Merge Sort

Answers were Sorted based on User's Feedback



Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / k.kavitha

1) Quick sort

Is This Answer Correct ?    25 Yes 2 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / prof.gagandeep jagdev

Quick Sort, Since the array is already sorted, so this can
be considered as Best case example. The complexity of quick
sort in best case is O(n log n). No doubt , same is the
complexity of Merge sort in best case, but Quick sort
enjoys priority over Merge Sort because Merge sort requires
extra memory( an array) to store the sorted result whereas
quick sort do not specify any such need.

Is This Answer Correct ?    10 Yes 1 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / rohith

quick sort is the best sorting algorithm because time
complexity is O(nlogn)

Is This Answer Correct ?    5 Yes 0 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / keerthana

Merge Sort.

Is This Answer Correct ?    6 Yes 5 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / sreejesh1987

*I think answer is Bubble sort,because some comparisons are there,but only one swap(4 and 5).

*Best case for for quick sort for this problem applicable to
54321 element set. Here many swaps and comparison will occur.

*Merge sort also does actions of swaps and comparisons.

For most arrays, quick sort and merge sort are better.
But for a simple problem like this, bubble sort consume less operations.

Is This Answer Correct ?    1 Yes 0 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / khushboo

BUbble sort

Quick Sort will take nlogn time and also merge sort

But bubble sort will take only O(n) as we can detect no
shift of position in first scan itself...

Is This Answer Correct ?    2 Yes 2 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / mini

bubble sort

Is This Answer Correct ?    4 Yes 5 No

Post New Answer

More C Interview Questions

How do I initialize a pointer to a function?

2 Answers  


#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output?

6 Answers   Ramco,


What language is c written?

0 Answers  


how to copy a string without using c function

5 Answers  


Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  






What is the size of array float a(10)?

0 Answers  


in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ?

11 Answers   IBM,


An entire structure variable can be assigned to another structure variable if __________

3 Answers   Sasken, TCS, Tech Mahindra, Wipro,


Explain About fork()?

0 Answers   TISL,


what is a static function

10 Answers   Satyam,


what is event driven software and what is procedural driven software?

0 Answers  


is assignment operator is arithmatic or not

3 Answers   Infosys,


Categories