2020-08-23 14:15:53 +00:00
|
|
|
//
|
|
|
|
// 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/
|
|
|
|
|
2022-02-25 19:20:45 +00:00
|
|
|
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_ba :=make ([]float64 ,len (array ));copy (_ba ,array );return _ba ;};_bab :=len (array )/2;_g :=MergeSort (array [:_bab ]);_a :=MergeSort (array [_bab :]);_gb :=make ([]float64 ,len (array ));_d :=0;_c :=0;_ge :=0;for _c < len (_g )&&_ge < len (_a ){if _g [_c ]<=_a [_ge ]{_gb [_d ]=_g [_c ];_c ++;}else {_gb [_d ]=_a [_ge ];_ge ++;};_d ++;};for _c < len (_g ){_gb [_d ]=_g [_c ];_c ++;_d ++;};for _ge < len (_a ){_gb [_d ]=_a [_ge ];_ge ++;_d ++;};return _gb ;};
|