2023-06-10 07:12:37 +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{_g :=make ([]float64 ,len (array ));copy (_g ,array );return _g ;};_b :=len (array )/2;_d :=MergeSort (array [:_b ]);_e :=MergeSort (array [_b :]);_ec :=make ([]float64 ,len (array ));_a :=0;_dc :=0;_fb :=0;for _dc < len (_d )&&_fb < len (_e ){if _d [_dc ]<=_e [_fb ]{_ec [_a ]=_d [_dc ];_dc ++;}else {_ec [_a ]=_e [_fb ];_fb ++;};_a ++;};for _dc < len (_d ){_ec [_a ]=_d [_dc ];_dc ++;_a ++;};for _fb < len (_e ){_ec [_a ]=_e [_fb ];_fb ++;_a ++;};return _ec ;};