Sorting Algorithm

Sorting Algorithm

A quick Intro to Sorting and the types of sorting Algorithms.

What is Sorting?

Sorting refers to arranging data in a selected layout i.e Sorting can be done in ascending and descending order. It arranges the data in a sequence which makes searching easier.

For example, consider an array A = {A1, A2, A3, A4, ?? An }, the array is called to be in ascending order if elements of A are arranged like A1 > A2 > A3 > A4 > A5 > ? > An. Hence the given array is sorted.

How do we perform Sorting?

First, we store the data in the array and then perform the different sorting methods to sort the Data in the asked order.

(Note:- Sorting method is discussed later in this blog)

In the above, we can see that the data( numbers) are stored in an array and then the one Sorting method is used to make the data( numbers) in a sorted manner( which is here in ascending order).

What is Sorting algorithm?

A sorting algorithm or a program is used to arrange elements of an array/list in a specific order.

Types of Sorting Algorithm:-

In the above article we come across the term Sorting methods, here are some popular sorting methods that we use in Data Structures and Algorithm:-

In the next blog, we are going to discuss all different types of Sorting algorithms one by one with explanations and Code snippets.