Sorting means to put all the elements in ascending order. The question that strikes our mind is that the first, what is the procedure involved in sorting through a process Selection Sort. Selection Sort is the process in which we repeatedly find the smallest element in the array from the unsorted subpart of the  array.

#Selection Sort

The selection sort in java algorithm sorts the array by repeatedly finding a minimum item (considering the ascending order) from an unsorted part and putting it at the beginning of the array. The algorithm maintains two subarrays in the given array.

  1. The subarray, which is already sorted.

  2. The remaining subarray is unsorted and about to be sorted.

In every iteration of the selection sort, the minimum item (considering ascending order) from an unsorted subarray is picked and moved to a sorted subarray.

#java #selection sort

Selection Sort In Java Example | Java Selection Sort Program
1.25 GEEK