コード例 #1
0
func readFromFile() []int {
	numbers, err := algocourse.ParseFileWithIntsOnEveryLine("QuickSort.txt")
	if err != nil {
		panic("Failed to read file: " + err.Error())
	}
	return numbers
}
コード例 #2
0
func main() {
	numbers, _ := algocourse.ParseFileWithIntsOnEveryLine("IntegerArray.txt")
	nInversions := MergeSortCountingInversions(numbers)
	fmt.Println("Inversions: ", nInversions)
}
コード例 #3
0
func main() {
	numbers, _ := algocourse.ParseFileWithIntsOnEveryLine("QuickSort.txt")
	fmt.Println("Comparisons: ", Quicksort(numbers, Ex1))
}