March 2019
Intermediate to advanced
336 pages
9h 9m
English
The main method initializes the integer array of 40 elements, and the elements are printed before and after sorting, as follows:
// main methodfunc main() { var elements []int elements = createArray(40) fmt.Println("\n Before Sorting \n\n", elements) fmt.Println("\n-After Sorting\n\n", MergeSorter(elements), "\n")}
Run the following command to execute the merge_sort.go file:
go run merge_sort.go
The output is as follows:

Let's take a look at the quick sort algorithm in the following section.
Read now
Unlock full access