Skip to content

Latest commit

 

History

History

circle_sort

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Circle sort

Circle sort algorithm compares the first element to the last element, then the second element to the second last element, etc.

Then split the array in two and recurse until there is only one single element in the array.

In short below two steps are repeated while there are swap operations involved in the steps.

  1. Compare the first element to the last element, then the second element to the second last element, etc.
  2. Then split the array in two and recurse until there is only one single element in the array.

This image explain it better

Circle sort diagram

Image source SourceForge