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/
|
|
|
|
|
2020-10-12 13:59:12 +00:00
|
|
|
package mergesort ;func MergeSort (array []float64 )[]float64 {if len (array )<=1{_ae :=make ([]float64 ,len (array ));copy (_ae ,array );return _ae ;};_aec :=len (array )/2;_d :=MergeSort (array [:_aec ]);_db :=MergeSort (array [_aec :]);_e :=make ([]float64 ,len (array ));_b :=0;_bf :=0;_g :=0;for _bf < len (_d )&&_g < len (_db ){if _d [_bf ]<=_db [_g ]{_e [_b ]=_d [_bf ];_bf ++;}else {_e [_b ]=_db [_g ];_g ++;};_b ++;};for _bf < len (_d ){_e [_b ]=_d [_bf ];_bf ++;_b ++;};for _g < len (_db ){_e [_b ]=_db [_g ];_g ++;_b ++;};return _e ;};
|