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 self-referential structure in c programming?
What is #include called?
What is clrscr in c?
What is gets() function?
Why is structure important for a child?
How can you convert integers to binary or hexadecimal?
What is #define in c?
Explain what are multibyte characters?
Differentiate call by value and call by reference?
How can you call a function, given its name as a string?
Is anything faster than c?
Explain can you assign a different address to an array tag?
What are the restrictions of a modulus operator?
What are inbuilt functions in c?
What is an array in c?