12 lines
945 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/
2022-06-27 19:44:23 +00:00
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_f :=make ([]float64 ,len (array ));copy (_f ,array );return _f ;};_d :=len (array )/2;_g :=MergeSort (array [:_d ]);_e :=MergeSort (array [_d :]);_gb :=make ([]float64 ,len (array ));_gc :=0;_fc :=0;_gg :=0;for _fc < len (_g )&&_gg < len (_e ){if _g [_fc ]<=_e [_gg ]{_gb [_gc ]=_g [_fc ];_fc ++;}else {_gb [_gc ]=_e [_gg ];_gg ++;};_gc ++;};for _fc < len (_g ){_gb [_gc ]=_g [_fc ];_fc ++;_gc ++;};for _gg < len (_e ){_gb [_gc ]=_e [_gg ];_gg ++;_gc ++;};return _gb ;};