Software Development

Selection Sort Algorithm Implementation in Java

Background

[wp_ad_camp_1]

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

[wp_ad_camp_2]

Get Codes from GitHub

[wp_ad_camp_3]

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

You Might Also Like