-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
36 lines (30 loc) · 1.13 KB
/
main.go
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
package main
import "fmt"
//to build: go build main.go AlgoFile.go
func main() {
//HanoiTowers
// s := 0
// HanoiTowers(6, 1, 3, &s)
// fmt.Println(s)
// fmt.Println(FastHanoiTowers(6), FastHanoiTowers(4))
//MergeSort
// list := []int{7, 92, 87, 1, 4, 3, 2, 6} //even number of elements
// list_odd := []int{7, 92, 87, 1, 4, 3, 2, 6, 22} //odd number of elements
// SortedList := MergeSort(list)
// SortedList_odd := MergeSort(list_odd)
// fmt.Println(SortedList, SortedList_odd)
//QuickSort
// list := []int{7, 92, 87, 1, 4, 3, 2, 6} //even number of elements
// list_odd := []int{7, 92, 87, 1, 4, 3, 2, 6, 22} //odd number of elements
// fmt.Println(list, list_odd)
// SortedList := QuickSort(list)
// SortedList_odd := QuickSort(list_odd)
// fmt.Println(SortedList, SortedList_odd)
//RandomizedQuickSort
list := []int{7, 92, 87, 1, 4, 3, 2, 6} //even number of elements
list_odd := []int{7, 92, 87, 1, 4, 3, 2, 6, 22} //odd number of elements
fmt.Println(list, list_odd)
SortedList := RandomizedQuickSort(list)
SortedList_odd := RandomizedQuickSort(list_odd)
fmt.Println(SortedList, SortedList_odd)
}