Forgot Password ?
New password will be sent to following email id
( Introduction )
A sorting algorithm is an algorithm that puts elements of a list in a certain order. Sorting algorithm specifies the way to arrange data in a particular order. Most common orders are numerical or <a href='https://en.wikipedia.org/wiki/Lexicographical_order' target='_blank'>lexicographical</a> order. <br> Some of the examples of sorting in real life scenarios are following. <ul> <li><b>Telephone Directory</b> - Telephone directory keeps telephone no. of people sorted on their names. So that names can be searched.</li> <li><b>Dictionary</b> - Dictionary keeps words in alphabetical order so that searching of any work becomes easy.</li> </ul> <br> <u><h4><b>General Considerations</b></h4></u> <ul> <li><h5><b>In-place sorting and Not-in-place sorting</b></h5> Sorting algorithms may require some extra space for comparison and temporary storage of few data elements. Those algorithms that do not require any extra space in sorting is said to be happened in-place, or for example, within the array itself. But in some sorting algorithms, the program requires space which is approximately equal to the elements being sorted. Sorting which uses such large space are called not-in-place sorting.</li> <li><h5><b>Stable and Not stable sorting</b></h5> If a sorting algorithm, after sorting the contents, does not change the sequence of similar content in which they appear, it is called stable sorting. <br><img src='https://s18.postimg.org/4qc2nsrqh/inp.jpg' style='width:45%'><br> If a sorting algorithm, after sorting the contents, changes the sequence of similar content in which they appear, it is called unstable sorting.<br><img style='width:45%' src='https://s13.postimg.org/3lvm1g5o7/nip.jpg'></li> <li><h5><b>Adaptive and Non-adaptive sorting algorithm</b></h5>A sorting algorithm is said to be adaptive, if it takes advantage of already 'sorted' elements in the list that is to be sorted. That is, while sorting if the source list has some element already sorted, adaptive algorithms will take this in to account and will try not to re-order them.A non-adaptive algorithm is one which does not take into account the elements which are already sorted. They try to force every single element to be re-order to confirm their sortedness. </ul>