mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-10 19:29:15 +08:00
12 lines
948 B
Go
12 lines
948 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{_a :=make ([]float64 ,len (array ));copy (_a ,array );return _a ;};_ae :=len (array )/2;_bc :=MergeSort (array [:_ae ]);_c :=MergeSort (array [_ae :]);_g :=make ([]float64 ,len (array ));_be :=0;_ca :=0;_bf :=0;for _ca < len (_bc )&&_bf < len (_c ){if _bc [_ca ]<=_c [_bf ]{_g [_be ]=_bc [_ca ];_ca ++;}else {_g [_be ]=_c [_bf ];_bf ++;};_be ++;};for _ca < len (_bc ){_g [_be ]=_bc [_ca ];_ca ++;_be ++;};for _bf < len (_c ){_g [_be ]=_c [_bf ];_bf ++;_be ++;};return _g ;}; |