Sorting Algorithm have some very important properties,which are also a main cause of complexities variations , means these properties are affecting the time & space complexities. properties are following :
- In-Place & Out-Place : In-Place property means ,when sorting algorithm don’t requires extra memory space to execute the complete sorting algorithm.
In Comparison based sorting algorithm except merge sort all are follow the In-Place properties.
Out-Place property means ,when sorting algorithms needs some extra memory space to execute algorithmic statement,merge sort have the Out-Place properties because merge sort requires some O(n) extra memory space,Apart from Merge Sort,Non-Comparison based sorting algorithm like Count Sort, Radix Sort and Bucket Sort are also follow the Out-Place properties.
- Online & Offline : Online property means ,when sorting algorithms are in running state(means statement are executing),and during the running time, if we add new data/element into array or list ,then algorithm must accept the new element/data.
In Comparison based sorting algorithm , only Insertion Sort have this property,remaining are not following Online property.
offline property means ,During the running state of sorting algorithm ,we can not add new element/Data into array or list.if we add then algorithm will not accept it and will fail.
except Insertion Sort all Non-Comparison based sorting algorithm are having the Offline property.
- Stable & Unstable : Stable means Order of elements should not change when elements are same.
example : Array X[]={1,2,6,6,7}, here in X there is two 6,during the execution of algorithm,first 6 should not go at the place of second 6 and vice-versa,means no need to swap when elements are same.
In Comparison based sorting algorithm,all algorithms are supporting Stability except Selection Sort, Quick Sort and Heap Sort.
Unstable means Order of elements can be change when elements are same.
In Non-Comparison based sorting algorithm , Count Sort ,Bucket Sorting are supporting stable property except Radix Sort.