Posts

Sorting Algorithms

Image
Before moving ahead, let's know about the sorting? It is a technique that is used to arrange the elements in ascending/descending/ or in any systematic order. So, the process of arranging the elements is called sorting. In this blog, we will compare all the sorting techniques and mentioned all the merits and demerits of the sorting techniques. There are mainly some sorting techniques used in the programming world: Bubble sort Selection sort Insertion sort Merge Sort Quick Sort Counting sort Radix sort Bucket sort Heap Sort Bubble sort Bubble sort is a simple comparison-based simple algorithm, It is a very slow technique than others, It is about twice as slow as selection sort and four times slow as insertion sort. So, this technique is not so useful in real applications. Bubble sort is a Stable,   in-place , and simple sorting technique. Time complexity and Space complexity Best Case Time complexity: O(n)   When an array is already sorted, so in this case, no swapping will perfo