mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-01 13:48:55 +08:00
12 lines
945 B
Go
12 lines
945 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{_f :=make ([]float64 ,len (array ));copy (_f ,array );return _f ;};_a :=len (array )/2;_af :=MergeSort (array [:_a ]);_g :=MergeSort (array [_a :]);_e :=make ([]float64 ,len (array ));_ef :=0;_fb :=0;_ab :=0;for _fb < len (_af )&&_ab < len (_g ){if _af [_fb ]<=_g [_ab ]{_e [_ef ]=_af [_fb ];_fb ++;}else {_e [_ef ]=_g [_ab ];_ab ++;};_ef ++;};for _fb < len (_af ){_e [_ef ]=_af [_fb ];_fb ++;_ef ++;};for _ab < len (_g ){_e [_ef ]=_g [_ab ];_ab ++;_ef ++;};return _e ;}; |