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
Which node is more powerful and can handle local information processing or graphics processing?
Is exit(status) truly equivalent to returning the same status from main?
What is pragma in c?
What is || operator and how does it function in a program?
What does s c mean in text?
What are the different types of control structures in programming?
write a program to display all prime numbers
How do you override a defined macro?
How to set file pointer to beginning c?
How is a null pointer different from a dangling pointer?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain Basic concepts of C language?
What is function in c with example?
What is structure in c language?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above