Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Rich Cook

Selection sort

Language Java | Level Intermediate | Category Algorithms | August 5, 2015 7:53 am


Algorithm Problem Description

Selection sort is a sorting algorithm that divide into the sorted and unsorted part. It moves unsorted items to sorted array every step. Selection sort is an in-place comparison sort and faster than bubble sort.

Write a program to implement selection sort.

Output

          	        
          	        

Unsorted array before sorting: [12, 11, 13, 5, 6, 7]
Sorted array after selection sorting: [5, 6, 7, 11, 12, 13]

          	        
          	        				    


Comments



Please login to add comments.