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 the benefit of using const for declaring constants?
What is the use of getch ()?
What is the difference between c and python?
Can you return null in c?
What is property type c?
What are bitwise shift operators in c programming?
Is main a keyword in c?
Explain pointers in c programming?
What is a constant and types of constants in c?
What are the modifiers available in c programming language?
Why n++ execute faster than n+1 ?
what are # pragma staments?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Why c is called procedure oriented language?
What is the use of gets and puts?