diff --git a/JAVA/Cyclesort.java b/JAVA/Cyclesort.java new file mode 100644 index 0000000..74c44ec --- /dev/null +++ b/JAVA/Cyclesort.java @@ -0,0 +1,27 @@ +// Online Java Compiler +// Use this editor to write, compile and run your Java code online +import java.util.Arrays; + +class Cyclesort{ + public static void main(String[] args) { + int[] arr={3,5,2,1,4}; + cyclicsort(arr); + System.out.println(Arrays.toString(arr)); + } + static void cyclicsort(int[] arr){ + int i=0; + while(i