In computer science, a Sorting algorithm is an algorithm that puts a random set of numbers into an ascending or decending sequence. A Sorting algorithm that puts the numbers in an ascending sequence is most widely used.
Sorting Algoritms are widely used in many other tasks such as searching, merging, Data Parsing, etc.
For eg:- Binary Search which is a well known searching algorithm that runs in O(logn) time needs the data to be sorted in
increasing order.
There are many different sorting algorithms, each with its own specific unique intuition and implementation.
They are classified according to two metrics: space complexity and time complexity.
Those two kinds of complexity are represented with asymptotic notations,
mainly with the symbols O, Θ, Ω, representing
respectively the upper bound, the tight bound, and the lower bound of the algorithm's complexity, specifying in brackets an expression in terms of
n, the number of the elements of the data sequence.
Most of them fall into following categories:
n.(n × log n).n.(n2).n.(n+k).Space and time complexity can also be further subdivided into 3 different cases: best case, average case and worst case.
Some Sorting algorithms are easy to understand while some cause havoc in one's mind. While it's not easy to learn everything and it’s not a good recommendation to learn a piece of code, so here we are with a fun way of understanding the sorting algorithms with visual depiction of prominent ones. So, Let’s get into it....