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
Answer Posted / 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 |
Post New Answer View All Answers
What is scope of variable in c?
What is c system32 taskhostw exe?
What is derived datatype in c?
Why isn't it being handled properly?
using only #include
what is reason of your company position's in india no. 1.
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Write a program to generate the Fibinocci Series
What is methods in c?
int i=10; printf("%d %d %d", i, i=20, i);
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
can we implement multi-threads in c.
What are loops in c?
what type of questions arrive in interview over c programming?
Is c pass by value or reference?