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
Why array is used in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
What is property type c?
What is the value of c?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is the use of static variable in c?
How can I send mail from within a c program?
When should the register modifier be used? Does it really help?
What are the uses of a pointer?
What is huge pointer in c?
Why string is used in c?
Why do we use stdio h and conio h?
What is the maximum no. of arguments that can be given in a command line in C.?
Can we increase size of array in c?