2021-06-16 07:10:52 +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{_b :=make ([]float64 ,len (array ));copy (_b ,array );return _b ;};_g :=len (array )/2;_ef :=MergeSort (array [:_g ]);_c :=MergeSort (array [_g :]);_d :=make ([]float64 ,len (array ));_cb :=0;_ga :=0;_f :=0;for _ga < len (_ef )&&_f < len (_c ){if _ef [_ga ]<=_c [_f ]{_d [_cb ]=_ef [_ga ];_ga ++;}else {_d [_cb ]=_c [_f ];_f ++;};_cb ++;};for _ga < len (_ef ){_d [_cb ]=_ef [_ga ];_ga ++;_cb ++;};for _f < len (_c ){_d [_cb ]=_c [_f ];_f ++;_cb ++;};return _d ;};