A programmer is a person who passes as an exacting expert on the basis of being able to turn out, after innumerable punching, an infinite series of incomprehensive answers calculated with micrometric precisions from vague assumptions based on debatable figures taken from inconclusive documents and carried out on instruments of problematical accuracy by persons of dubious reliability and questionable mentality for the avowed purpose of annoying and confounding a hopelessly defenseless department that was unfortunate enough to ask for the information in the first place. Grid newsmagazine

Exchange Sort

Language Java | Level Intermediate | Category Algorithms | August 3, 2015 7:59 am


Algorithm Problem Description

The exchange sort is a sorting algorithm that compares each item with other items of the array and swap the item if requires.

Sort the items by exchanging pairs of items until the sequence is sorted. In general, an algorithm may exchange adjacent elements as well as widely separated one.

Output

          	        
          	        

Unsorted array before sorting: [12, 11, 13, 5, 6, 7]
Sorted array After Exchange Sort sorting: [5, 6, 7, 11, 12, 13]

          	        
          	        				    


Comments



Please login to add comments.