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
What are pointers? Why are they used?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Where is c used?
Can you subtract pointers from each other? Why would you?
What is the difference between abs() and fabs() functions?
in linking some of os executables are linking name some of them
What are the scope of static variables?
Whats s or c mean?
What is the difference between array and pointer?
Who is the founder of c language?
What are the advantages of c language?
differentiate built-in functions and user – defined functions.
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
Write the control statements in C language