2024-05-22 00:21:11 +00:00

14 lines
942 B
Go

//
// 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/
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_f :=make ([]float64 ,len (array ));copy (_f ,array );return _f ;};_fa :=len (array )/2;_g :=MergeSort (array [:_fa ]);_e :=MergeSort (array [_fa :]);_ae :=make ([]float64 ,len (array ));
_gg :=0;_c :=0;_ge :=0;for _c < len (_g )&&_ge < len (_e ){if _g [_c ]<=_e [_ge ]{_ae [_gg ]=_g [_c ];_c ++;}else {_ae [_gg ]=_e [_ge ];_ge ++;};_gg ++;};for _c < len (_g ){_ae [_gg ]=_g [_c ];_c ++;_gg ++;};for _ge < len (_e ){_ae [_gg ]=_e [_ge ];_ge ++;
_gg ++;};return _ae ;};