Computer Science, asked by achyutananda69, 7 months ago

The input to a merge sort is
6,5,4,3,2,1 and the same input is
applied to quick sort then which
is the best algorithm in this case
*
O Merge sort
O Quick sort
Both have same time
O complexity in this case as they
have same running time
O Cannot be decided
The memory available for​

Answers

Answered by sukhman7151
2

Answer:

but bbbdbdbtbhhgfhfhhxgxbbxxnbc clg x zbznzndjdhxxhhddhhddhdhdhfhjd

Explanation:

rnnttntn

Answered by umarmir15
0

Answer:

The correct option is 3) Complexity in this case as they have same running time.

Because it is mentioned in the question clearly that input is applied at the same time in both the merge Sort and the Quick Sort.

Explanation:

Quick sort

It is an internal algorithm which is based on divide and conquer strategy. In the quick sort algorithm

The array of elements is divided into parts in repeatedly times until it is not possible to divide these array of elements further.

It is also known as “partition exchange sort”. It seperates the array elements.

It uses a key element (pivot) for partitioning the elements. It has a unique function for partitioning the elements.

One left partition contains all those elements that are smaller than the pivot and one right partition contains all those elements which are greater than the key element. Thats how the Quick Sort algorithm works.

Merge sort

It is an external algorithm and based on divide and conquer strategy. In the Merge Sort algorithm we have:

The elements are split into two sub-arrays (n/2) again and again repeatedly until only one element is left in the algorithm.

It uses additional storage for sorting the auxiliary array. Because it is mixture it needs more storage to do work.

It uses the arrays where two are used for storing each half, and the third external one is used to store the final sorted list by merging other two and each array is then sorted recursively.

At last, the all sub arrays are merged to make it ‘n’ element size of the array.

Similar questions