Functions
func Sort
func Sort(data Interface)
Sort sorts data. It makes one call to data.Len to determine n and O(n*log(n)) calls to data.Less and data.Swap. The sort is not guaranteed to be stable.
排序对数据进行排序。它对data.Len进行一次调用以确定n,并对data.Less和data.Swap进行O(n*log(n))调用。该排序不保证是稳定的。
func Stable
func Stable(data Interface)
Stable sorts data while keeping the original order of equal elements.
It makes one call to data.Len to determine n, O(nlog(n)) calls to data.Less and O(nlog(n)*log(n)) calls to data.Swap.
稳定地对数据进行排序,同时保持相等元素的原始顺序。
它对data.Len进行一次调用以确定n,
对data.Less进行O(nlog(n))调用,
对data.Swap进行O(nlog(n)*log(n))调用。