


Let’s discuss the Bubble Sort Technique in Java. Uses divide and conquer to sort the collection.įinds the smallest element in the collection and put it in its proper place at the end of every iterationĮlements are sorted by building min heap or max heap.Īpart from the sorting techniques given in the above table, Java also supports the following sorting techniques:īut these techniques are used sparingly in practical applications, thus these techniques will not be part of this series. Most efficient and optimized sorting technique. Divides the collection into simpler sub-collections, sorts them and then merges everything

It follows the divide and conquer approach. Inserts each element of the collection in its proper place. At the end of each iteration, the heaviest element gets bubbled up at its proper place. Compares the current element to adjacent elements repeatedly.
