• Last Updated : 01 Aug, 2022

In certain sorting problems, if the data is already sorted the complexity of the sorting algorithm changes. That is it can be said that the time complexity depends on the order of a given input.

Based on the dependency of time complexity on the arrangement of array, the sorting algorithms can be divided into two groups:

1. Adaptive Sorting Algorithms
2. Non-adaptive Sorting Algorithms

The sorting algorithms in which the order of elements affects the time complexity of the sorting algorithm is known as an adaptive sorting algorithm.

In adaptive sorting, if the data is already sorted, the algorithm will not reorder the elements. As a result, it reduces the number of iterations and improves execution speed.

Here is a list of sorting algorithms that are adaptive :

In the case of adaptive sorting algorithms, if the array is already sorted it takes linear time to perform sorting i.e., O(N) time.

• When the data is already sorted, it consumes less time.
• They generally load faster.
• Improved execution speed.

The sorting algorithms in which the order of elements of the data doesn’t affect the time complexity of the sorting algorithms are known as non-adaptive sorting algorithms.

In a non-adaptive algorithm, the time complexity remains the same for any order of the array. A non-adaptive sorting algorithm tries to force all the items into sorted order.

Here is a list of Non-Adaptive sorting algorithms: