jsjhusg

cjsdhcudihc

Sorting Algorithm

Sorting algorithm are basically used to sort a data according to a specific order e.g. like in numerical order (ascending or descending order ) or lexicographical order.

Efficient sorting is important for optimizing the efficiency of oher algorithms.This opeartion is one of the most important and widespread in computer science .

There are currently hundreds of different sorting algorithms which have their own advantages . All these algorithms are basically divided on basis of 2 factors and they are :

1. Space complexity
2. Time complexity

These complexity are represented with the help of asymptotic notation . There are basically 5 asymptotic notations

1.BIG-OH NOTATION (O)
2. BIG-OMEGA NOTATION (Ω)
3. THEATA NOTATION (Θ)
4. LITTLE-OH NOTATION (o)
5. LITTLE-OMEGA NOTATION (ω)

We mostly use first 3 notations.

Most of the sorting algorithm falls into either into

1: Logarithmic
Here the complexity of the algorithm is O(n log n) for example like Merge sort , Heap sort, Shell sort and many more.

2. Quadratic
Here the complexity of the algorithm is O(n2) for example like Bubble sort, Selection Sort , Insertion sort ,Quick sort and their are many more.