2023-12-28 15:53:06 +00:00

14 lines
943 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 ;};_d :=len (array )/2;_bd :=MergeSort (array [:_d ]);_ed :=MergeSort (array [_d :]);_bc :=make ([]float64 ,len (array ));
_g :=0;_f :=0;_eb :=0;for _f < len (_bd )&&_eb < len (_ed ){if _bd [_f ]<=_ed [_eb ]{_bc [_g ]=_bd [_f ];_f ++;}else {_bc [_g ]=_ed [_eb ];_eb ++;};_g ++;};for _f < len (_bd ){_bc [_g ]=_bd [_f ];_f ++;_g ++;};for _eb < len (_ed ){_bc [_g ]=_ed [_eb ];
_eb ++;_g ++;};return _bc ;};