Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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

Answers were Sorted based on User's Feedback



Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / k.kavitha

1) Quick sort

Is This Answer Correct ?    25 Yes 2 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / 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

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / rohith

quick sort is the best sorting algorithm because time
complexity is O(nlogn)

Is This Answer Correct ?    5 Yes 0 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / keerthana

Merge Sort.

Is This Answer Correct ?    6 Yes 5 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / sreejesh1987

*I think answer is Bubble sort,because some comparisons are there,but only one swap(4 and 5).

*Best case for for quick sort for this problem applicable to
54321 element set. Here many swaps and comparison will occur.

*Merge sort also does actions of swaps and comparisons.

For most arrays, quick sort and merge sort are better.
But for a simple problem like this, bubble sort consume less operations.

Is This Answer Correct ?    1 Yes 0 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / khushboo

BUbble sort

Quick Sort will take nlogn time and also merge sort

But bubble sort will take only O(n) as we can detect no
shift of position in first scan itself...

Is This Answer Correct ?    2 Yes 2 No

Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Qu..

Answer / mini

bubble sort

Is This Answer Correct ?    4 Yes 5 No

Post New Answer



More C Interview Questions

What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

0 Answers  


What are the types of unary operators?

0 Answers  


You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

2 Answers   Qualcomm,


Write a C program where input is: "My name is xyz". output is: "xyz is name My".

1 Answers   TCS,


To find whether a number is even or odd without using any conditional operator??

12 Answers   College School Exams Tests, IBM,






What are the keywords in c?

0 Answers  


What is difference between function overloading and operator overloading?

0 Answers  


How can we open a file in Binary mode and Text mode?what is the difference?

1 Answers   PanTerra,


write a program to find the number of even integers and odd integers in a given array in c language

13 Answers   IAI Cameroun, NIIT, Olive Tech, QIS,


Given an array A[n+m] of n+m numbers, where A[1] ... A[n] is sorted and A[n+1] ... A[n+m] is sorted. Design a linear time algorithm to obtain A[1...n+m] sorted using only O(1) extra space. Time Complexity of your algorithm should be O(n) and Space Complexity O(1).

0 Answers  


increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


how to find the given number is prime or not?

6 Answers   IMS, ING,






Categories