12 lines
934 B
Go
Raw Normal View History

2020-08-23 14:15:53 +00:00
//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
2021-08-23 20:44:48 +00:00
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_dd :=make ([]float64 ,len (array ));copy (_dd ,array );return _dd ;};_f :=len (array )/2;_g :=MergeSort (array [:_f ]);_a :=MergeSort (array [_f :]);_b :=make ([]float64 ,len (array ));_gg :=0;_e :=0;_fb :=0;for _e < len (_g )&&_fb < len (_a ){if _g [_e ]<=_a [_fb ]{_b [_gg ]=_g [_e ];_e ++;}else {_b [_gg ]=_a [_fb ];_fb ++;};_gg ++;};for _e < len (_g ){_b [_gg ]=_g [_e ];_e ++;_gg ++;};for _fb < len (_a ){_b [_gg ]=_a [_fb ];_fb ++;_gg ++;};return _b ;};