From aee03ba608f45fb7f3809b99b9e41829960c7637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=A2=93=E9=98=B3?= <623287207@qq.com> Date: Thu, 6 Aug 2020 22:15:47 +0800 Subject: [PATCH] first commit --- SelectionSort.java | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 SelectionSort.java diff --git a/SelectionSort.java b/SelectionSort.java new file mode 100644 index 0000000..ef8d735 --- /dev/null +++ b/SelectionSort.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package sort; + +/** + * + * @author User + */ +public class SelectionSort { + + private static void exch(int[] a,int i,int j){ + int t=a[i]; + a[i]=a[j]; + a[j]=t; + } + public void sort(int[] a){ + int N=a.length; + for(int i=0;i