The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
1) The subarray which is already sorted.
2) Remaining subarray which is unsorted.
In every iteration of selection sort, the minimum element (considering ascending order) from the unsorted subarray is picked and moved to the sorted subarray.
Please refer complete article on Selection Sort for more details!
- LongStream.Builder build() in Java
- DoubleStream.Builder build() in Java
- Java 8 | Consumer Interface in Java with Examples
- MouseListener and MouseMotionListener in Java
- Java Program for Bubble Sort
- Java Program for Insertion Sort
- Java Program for Heap Sort
- Java Program for Radix Sort
- Java Program for n-th Fibonacci numbers
- Java Program for Counting Sort
- Java Program for ShellSort
- Java Program for Longest Common Subsequence
- Java Program for Binary Search (Recursive and Iterative)
- Java Program 0-1 Knapsack Problem
- Java Program for Min Cost Path