Site icon Study Algorithms

SORTING and its types

What is sorting?

Sorting is an algorithm that arranges the elements of a list in a certain order (either ascending or descending, as per the requirement). The output is simply a permutation of the input data.

Why sorting?

Sorting is one of the most important categories of algorithms in computer science. Sometimes sorting significantly reduces the problem complexity. We can use sorting as a technique to reduce the search complexity. Great research went into this category of algorithms because of its importance. These algorithms are very much used in many computer algorithms [for example searching algorithms, database algorithms etc].

Classification

Sorting algorithms are generally classified into different categories based on these parameters:-

Types of DATA

Apart from the above discussed classification, we have different types of data also upon which we need to apply sorting algorithms. Depending upon the type of data we need to choose a time efficient algorithm. In such a case some before hand knowledge of the data comes handy. Different types of data can be:-

Considering these cases, we will try to analyze the following algorithms:-

A good interpretation of the running times of these sorts can be found here.

Linear Sorting Algorithms:-

The above examples are based on comparisons. Among all of them, the best was O(n log(n)). There are also some linear sorting algorithms that can sort in O(n) based on given assumptions of input data. Some of them are:-

Exit mobile version