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 / 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 |
Post New Answer View All Answers
largest Of three Number using without if condition?
What is the difference between the expression “++a” and “a++”?
What is queue in c?
What does & mean in scanf?
Can we add pointers together?
Explain what is wrong with this program statement?
Can a pointer be null?
c program to compute AREA under integral
Why is c still so popular?
What is an lvalue?
Why c is called a middle level language?
What is the difference between near, far and huge pointers?
What is a good data structure to use for storing lines of text?
What is volatile, register definition in C
Array is an lvalue or not?