From 30c184002cce3c41edddaa69e9110eddad3e34e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B6=E5=A3=AB=E6=B6=B5?= <630892807@qq.com> Date: Tue, 18 Aug 2020 22:27:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E7=BD=B2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/html/setting_bottom.html | 2 +- static/html/setting_deploy.html | 34 +++++++++++++++++++++------------ tools/sorts.go | 27 ++++++++++++++++++++++++++ tools/sorts_test.go | 12 ++++++++++++ 4 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 tools/sorts.go create mode 100644 tools/sorts_test.go diff --git a/static/html/setting_bottom.html b/static/html/setting_bottom.html index 00764e0..b52de3b 100644 --- a/static/html/setting_bottom.html +++ b/static/html/setting_bottom.html @@ -156,7 +156,7 @@ _this.mysql.port=result.Port; }); } - if(ACTION=="setting_kefu_list"||ACTION=="setting_deploy"){ + if(ACTION=="setting_kefu_list"){ this.sendAjax("/kefulist","get",{},function(result){ _this.kefuList=result; }); diff --git a/static/html/setting_deploy.html b/static/html/setting_deploy.html index 8299f9f..6c749ae 100644 --- a/static/html/setting_deploy.html +++ b/static/html/setting_deploy.html @@ -7,18 +7,28 @@ - - - - - - - - - - 立即生成 - - + + + + + + + + diff --git a/tools/sorts.go b/tools/sorts.go new file mode 100644 index 0000000..9a9e031 --- /dev/null +++ b/tools/sorts.go @@ -0,0 +1,27 @@ +package tools +//划分 +func partition(arr *[]int,left int,right int)int{ + privot:=(*arr)[right] + i:=left-1 + for j:=left;j= right{ + return + } + privot:=partition(arr,left,right) + QuickSort(arr,left,privot-1) + QuickSort(arr,privot+1,right) +} \ No newline at end of file diff --git a/tools/sorts_test.go b/tools/sorts_test.go new file mode 100644 index 0000000..75f0854 --- /dev/null +++ b/tools/sorts_test.go @@ -0,0 +1,12 @@ +package tools + +import ( + "testing" +) + +func TestQuickSort(t *testing.T) { + arr:=[]int{1,8,3,9,4,5,4,7} + t.Log(arr) + QuickSort(&arr,0,len(arr)-1) + t.Log(arr) +}