[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/AllAlgorithms/java/master/sorting/Cyclesort.java [Back]  [Original]

// Java program to impleament cycle sort

import java.util.*;
import java.lang.*;

class Cyclesort
{
// Function sort the array using Cycle sort
	public static void cycleSort (int arr[], int n)
	{
		// count number of memory writes
		int writes = 0;

		// traverse array elements and put it to on
		// the right place
		for (int cycle_start=0; cycle_start

Web Proxy Viewer  |  New URL  |  Original Page