2021-11-10 11:45:21 +00:00

12 lines
940 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{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_af :=len (array )/2;_f :=MergeSort (array [:_af ]);_c :=MergeSort (array [_af :]);_ff :=make ([]float64 ,len (array ));_fc :=0;_d :=0;_fd :=0;for _d < len (_f )&&_fd < len (_c ){if _f [_d ]<=_c [_fd ]{_ff [_fc ]=_f [_d ];_d ++;}else {_ff [_fc ]=_c [_fd ];_fd ++;};_fc ++;};for _d < len (_f ){_ff [_fc ]=_f [_d ];_d ++;_fc ++;};for _fd < len (_c ){_ff [_fc ]=_c [_fd ];_fd ++;_fc ++;};return _ff ;};