2023-03-01 18:42:44 +00:00

12 lines
937 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{_c :=make ([]float64 ,len (array ));copy (_c ,array );return _c ;};_d :=len (array )/2;_cd :=MergeSort (array [:_d ]);_b :=MergeSort (array [_d :]);_g :=make ([]float64 ,len (array ));_ef :=0;_ba :=0;_f :=0;for _ba < len (_cd )&&_f < len (_b ){if _cd [_ba ]<=_b [_f ]{_g [_ef ]=_cd [_ba ];_ba ++;}else {_g [_ef ]=_b [_f ];_f ++;};_ef ++;};for _ba < len (_cd ){_g [_ef ]=_cd [_ba ];_ba ++;_ef ++;};for _f < len (_b ){_g [_ef ]=_b [_f ];_f ++;_ef ++;};return _g ;};