MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / sort

Method sort

Java/Leetcode/Leetcode287.java:13–24  ·  view source on GitHub ↗
(int[] arr)

Source from the content-addressed store, hash-verified

11 }
12
13 static void sort(int[] arr){
14 int i=0;
15 while(i<arr.length){
16 int correctIndex=arr[i]-1;
17 if(arr[i]!=arr[correctIndex]){
18 swap(arr,i,correctIndex);
19 }
20 else {
21 i++;
22 }
23 }
24 }
25
26
27 static void swap(int[] arr, int a, int b){

Callers 9

mainMethod · 0.95
intersectionMethod · 0.45
mergeIntervalsMethod · 0.45
mainFunction · 0.45
anagram_checkerFunction · 0.45
check_vowels.pyFile · 0.45
perFunction · 0.45
getSkylineMethod · 0.45
longestStrChainMethod · 0.45

Calls 1

swapMethod · 0.95

Tested by 1

mainFunction · 0.36