mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
12 lines
940 B
Go
12 lines
940 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{_c :=make ([]float64 ,len (array ));copy (_c ,array );return _c ;};_bf :=len (array )/2;_bc :=MergeSort (array [:_bf ]);_f :=MergeSort (array [_bf :]);_a :=make ([]float64 ,len (array ));_d :=0;_ff :=0;_ce :=0;for _ff < len (_bc )&&_ce < len (_f ){if _bc [_ff ]<=_f [_ce ]{_a [_d ]=_bc [_ff ];_ff ++;}else {_a [_d ]=_f [_ce ];_ce ++;};_d ++;};for _ff < len (_bc ){_a [_d ]=_bc [_ff ];_ff ++;_d ++;};for _ce < len (_f ){_a [_d ]=_f [_ce ];_ce ++;_d ++;};return _a ;}; |