2020-08-31 22:58:25 +00:00

12 lines
945 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 ;};_f :=len (array )/2;_g :=MergeSort (array [:_f ]);_gg :=MergeSort (array [_f :]);_b :=make ([]float64 ,len (array ));_ea :=0;_fd :=0;_cc :=0;for _fd < len (_g )&&_cc < len (_gg ){if _g [_fd ]<=_gg [_cc ]{_b [_ea ]=_g [_fd ];_fd ++;}else {_b [_ea ]=_gg [_cc ];_cc ++;};_ea ++;};for _fd < len (_g ){_b [_ea ]=_g [_fd ];_fd ++;_ea ++;};for _cc < len (_gg ){_b [_ea ]=_gg [_cc ];_cc ++;_ea ++;};return _b ;};