Hello Guys๐ I Hope you are doing great !! This is a short article, and in this, you will get a brief introduction to sorting algorithms.
Without Further Ado, Let's get started ๐!!
Introduction
Sorting is nothing but an arrangement of elements in an ordered sequence like highest to lowest or lowest to highest or some alphabetical order.
These are some common sorting algorithms that we will discuss in this series.
- Bubble Sort
- Selection Sort
- Insertion Sort
- Merge Sort
- Counting Sort
- Quick Sort
Before going into each algorithm, let's first know some factors on which sorting algorithms are classified.
Classification of Sorting Algorithms
In-place sorting: These algorithms do not require any extra space for comparison and temporary storage of a few data elements. It only needs the input space, excluding the constant space used for variables or iterators and the space used for stack in the recursive algorithms.
Examples: Bubble Sort, Selection Sort, Insertion Sort, Quicksort, etc.Out-place sorting: These algorithms require extra space for sorting
Examples: Merge Sort, Counting Sort, etc.Stable sorting: In these algorithms, two objects with equal keys appear in the same order before and after sorting
Examples: Bubble Sort, Insertion Sort, Merge Sort, Counting Sort, etc.Un-stable sorting: In these algorithms, two or more objects with equal keys don't appear in the same order before and after sorting
Examples: Selection Sort, Quick Sort, etc.Adaptive sorting: In these algorithms, the order of occurrence of elements in the input affects the time complexity of a sorting algorithm
Examples: Bubble Sort, Insertion Sort, Quick Sort, etc.Non-adaptive sorting: In these algorithms, the order of occurrence of elements does not affect the time complexity of a sorting algorithm
Examples: Selection Sort, Merge Sort, etc.Comparision sorting: These algorithms compare elements at each step of the algorithm to determine if one element should be to the left or right of another element.
Examples: Bubble Sort, Selection Sort, Insertion sort, Merge Sort, etc.Integer sorting: These type of algorithms do not make comparisons. Integer sorts determine for each elementโ x, how many elements are less than x. This type of algorithm is used to immediately place each element into the correct slot โ no need to rearrange lists.
Example: Counting Sort
Here is the Complexity's of Different Sorting Algorithms
๐โConclusion
Finally, In this article, we learned about some classifications of sorting algorithms. Now we are ready for learning algorithms ๐๐ฉโ๐
What's Next โญ?
Thank you for reading so far๐. I hope you enjoyed following it and are ready to learn sorting algorithms.
In the coming parts, we will discuss about each Sorting Algorithm in detail !! So Stay Tuned๐๐!!!!
Do share your valuable suggestions and your honest feedback. If you have any comments, questions, or concerns, Do comment them, and I am more than happy to take them๐ฌ.
Happy Learning ๐๐!!