Arranging the data in a particular format is known as Sorting. The way in which the data is arranged in a particular order is Algorithm sorting. Mostly the order in which the data is arranged is either numerical or lexicographical order.
The sorted data facilitates in optimizing the process of data searching. Also facilitates in representing the data in readable format. Real-life examples of sorting are:
To sort an algorithm some extra space is required for comparison and temporary storage is required for few data elements, which do not need extra space for sorting, and is known as in-place sorting. Example of in-place sorting is Bubble sort.
In some algorithm sorting, space is required by the program. The space required is equivalent to that of the stored elements. Sorting that requires more or equal space of an element is known as not-in-place sorting. Example of no-in-space sorting is Merge-sort.
After the sorting of the contents, if the sequence of the sorting algorithm does not change and appear almost similar in which they originally appear is known as stable sorting.
After the sorting of the contents, if the sequence of the sorting algorithm change and appear almost similar in which they originally appear is known as Not Stable Sorting.
When the sequence of the original elements is desired to maintain, then the stability of the algorithm matters.
If an algorithm has already the sorted elements in the list which is to be sorted, then the sorting algorithm is said to be adaptive. The adaptive algorithm takes into account that the source list has already sorted some element, and will not re-order them
A non-adaptive algorithm does not take into account the elements which are already sorted is tried to force every single element to be re-ordered to confirm their sortedness.
Some of the terms which are used in the Data Structure Sorting technique are:
If the successive element is greater than the previous one, the sequence of values is to be in Increasing Order. For instance, 1, 3, 4, 6, 8, 9 are in increasing order, as every next element is greater than the previous element.
If the successive element is less than the current one, the sequence of values is to be in Decreasing Order. For instance, 9, 8, 6, 4, 3, 1 are in decreasing order, as every next element is less than the current element.
If the successive element is less than or equal to its previous element in the sequence, then the sequence of values is said to be in Non-Increasing Order. This order occurs when the sequence contains duplicate values. For instance, 9, 8, 6, 3, 3, 1 are in non-increasing order, as every next element is less than or equal to (in case of 3) but not greater than any previous element.
If the successive element is greater than or equal to its previous element in the sequence then the sequence of values is said to be in Non-Decreasing Order. This order occurs when the sequence contains duplicate values. For instance, 1, 3, 3, 6, 8, 9 are in non-decreasing order, as every next element is greater than or equal to (in case of 3) but not less than the previous one.
Data Structure & Algorithms Related Interview Questions
|RDBMS Interview Questions||DBMS Interview Questions|
|Adv Java Interview Questions||Core Java Interview Questions|
|C Interview Questions||Database Administration Interview Questions|
|CSS Advanced Interview Questions||Maven Interview Questions|
|Computer architecture Interview Questions||Object Oriented Analysis and Design Interview Questions|
|Standard Template Library (STL) Interview Questions||Xml Publisher Interview Questions|
Data Structure & Algorithms Tutorial
Data Structure & Algorithms
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.