Skip to content

Instantly share code, notes, and snippets.

@mjpurin
Created January 19, 2020 12:58
Show Gist options
  • Save mjpurin/5b4998b045c65cdb391397981a807026 to your computer and use it in GitHub Desktop.
Save mjpurin/5b4998b045c65cdb391397981a807026 to your computer and use it in GitHub Desktop.
配列ソート(単純ソート)
public void sortArr(int[] arr){
for(int i=0;i<arr.length-1;i++){
int index=new java.util.Random().nextInt(arr.length-i);
int temp=arr[index];
arr[index]=arr[arr.length-1-i];
arr[arr.length-1-i]=temp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment