Sorting Algorithms Introduction

Sorting Algorithms Introduction

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.

  1. Bubble Sort
  2. Selection Sort
  3. Insertion Sort
  4. Merge Sort
  5. Counting Sort
  6. 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

screenshot of BigOCheetSheet

๐Ÿ–โ˜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 ๐Ÿ˜Š๐Ÿ‘!!

Did you find this article valuable?

Support Sree Gayathri Siddamsetti by becoming a sponsor. Any amount is appreciated!

ย