gsort

package
v0.0.0-...-a046bda Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(sli []int) []int

timeSort排序 TimSort 是 Tim Peters 在 2002年提出的一种算法,它是归并算法的一种改进算法 基本思想: TimSort 的主要思想是:通过遍历数组,将数组拆分成若干个单调递增的子数组。 每一块称为一个 run。拆分完成后,再将 run 两两合并起来。 在遍历数组时,如果遇到单调递减的小块,TimSort 会将其翻转使其单调递增。 TimSort 在对部分有序的数组进行排序时,速度很快。而现实世界中的数据往往总是部分有序的 参考:https://leetcode-cn.com/leetbook/read/sort-algorithms/phga33/

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL