5,942 views
1 1 vote
Is Quick sort an adaptive sorting Algorithm? I think no. Because as per the definition given in the Wikipedia is that A adaptive sorting Algorithm is one who takes the advantage of preorderedness of the input. But in case of Quick sort it act as disadvantage.

2 Answers

1 1 vote
Quick sort is Adaptive sorting algorithm because the time complexity of Quick sort depends on the  initial input sequence (pre- orderedness).

Adaptive sorting algorithms:
1. Bubble Sort
2. Insertion Sort
3. Quick Sort

Non-adaptive sorting algorithms:
1. Selection Sort
2. Merge Sort
3. Heap Sort
1 1 vote

An adaptive algorithm is an algorithm that changes its behavior on given input sequence.

in quick sort:

  • If input sequence is sorted then time complexity become O(n^2).
  • If input sequence is not sorted then time time complexity become O(nlogn).

So quick sort change its behavior based on inout sequence so it is adaptive algo.

in merge sort:

  • If input sequence is sorted then time complexity become O(nlogn).
  • If input sequence is not sorted then time time complexity also become O(nlogn).

So merge sort not change its behavior based on input sequence so it is non adaptive algo.

 

Position:
Show:

Related questions

2 2 votes
2 answers 2 answers
2.6k
2.6k views
Bikram asked Nov 26, 2016
2,645 views
Meena is working in an IT company as HR manager. She has a large list of potential candidates to be recruited which are all sorted by their names. But she found that due ...
4 4 votes
4 answers 4 answers
4.8k
4.8k views
Ramij asked Dec 20, 2018
4,814 views
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst ca...
4 4 votes
1 1 answer
4.4k
4.4k views
Prince Sindhiya asked Aug 23, 2018
4,395 views
. In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared?a)2b)lognc)n-1d)nlogn
0 0 votes
0 0 answers
947
947 views
Rahul Ranjan 1 asked Jun 15, 2018
947 views
You are asked to sort 15 randomly generated numbers. One should prefer - 1. Bubble Sort2. Quick Sort3. Merge Sort4. Heap Sort Please explain why others 3 sorting algorith...