mirror of
https://github.com/unidoc/unioffice.git
synced 2025-05-02 22:17:07 +08:00
14 lines
937 B
Go
14 lines
937 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{_d :=make ([]float64 ,len (array ));copy (_d ,array );return _d ;};_e :=len (array )/2;_c :=MergeSort (array [:_e ]);_ce :=MergeSort (array [_e :]);_ec :=make ([]float64 ,len (array ));
|
|
_b :=0;_f :=0;_dd :=0;for _f < len (_c )&&_dd < len (_ce ){if _c [_f ]<=_ce [_dd ]{_ec [_b ]=_c [_f ];_f ++;}else {_ec [_b ]=_ce [_dd ];_dd ++;};_b ++;};for _f < len (_c ){_ec [_b ]=_c [_f ];_f ++;_b ++;};for _dd < len (_ce ){_ec [_b ]=_ce [_dd ];_dd ++;
|
|
_b ++;};return _ec ;}; |