0

Selection Sort Algorithm Implementation in Java

Background

This article demonstrates how to implement Selection Sort algorithm in Java.

Hardware Environment

n/a

Software Environment

  • Windows 7 Professional SP1
  • Eclipse – Kepler Release
  • Java 1.7 (1.7.0_67 – Windows x86)

Simple Description

Selection Sort is an algorithm that processes a list of values by dividing it into two parts – the already sorted and the unsorted remaining portion.┬áThe first list value is replaced with the smallest value from second to the last value if the first value is greater than the smallest value. ┬áThen, the second value is replaced with the smallest value from the third to the last value and so on until it reaches the last value.
For example:
java-selection-sort

Selection Sort Algorithm in Java

Get Codes from GitHub

https://github.com/Turreta/Java-Algorithms/blob/master/src/com/turreta/algorithm/sort/selection/SelectionSort.java