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 keywords c?
What do you understand by friend-functions? How are they used?
Which built-in library function can be used to match a patter from the string?
What is void pointers in c?
Why we use stdio h in c?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Is multithreading possible in c?
Why c is called a middle level language?
What are the applications of c language?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
How is = symbol different from == symbol in c programming?
Explain how do you use a pointer to a function?
What are pointers in C? Give an example where to illustrate their significance.
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???