-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_sort_test.go
More file actions
44 lines (33 loc) · 856 Bytes
/
basic_sort_test.go
File metadata and controls
44 lines (33 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package basic_algorithms
import (
"fmt"
"testing"
)
var array=[]int{6, 5, 3, 1, 8, 7, 2, 4}
func TestBubbleSort(t *testing.T) {
rlist:=BubbleSort(array)
fmt.Println("TestBubbleSort result:",rlist)
}
func TestSelectSort(t *testing.T) {
rlist:=SelectSort(array)
fmt.Println("TestSelectSort result:",rlist)
}
func TestInsertSort(t *testing.T) {
rlist:=InsertSort(array)
fmt.Println("TestInsertSort result:",rlist)
}
func TestMergeSort(t *testing.T) {
rlist:=MergeSort(array)
fmt.Println("TestMergeSort result:",rlist)
}
func TestMergeRecursive(t *testing.T) {
rlist:=MergeRecursive(array)
fmt.Println("TestMergeRecursive result:",rlist)
}
func TestQuickSort(t *testing.T) {
rlist:=QuickSort(array,0,len(array)-1)
fmt.Println("TestMergeRecursive result:",rlist)
}
func TestHeapSort(t *testing.T) {
fmt.Println(HeapSort(array))
}