Documentation
¶
Overview ¶
Package dashsort
常见排序算法封装
Common sorting algorithm encapsulation
Index ¶
- func Bubble[T constraints.Ordered](sli []T)
- func Bubble2[T constraints.Ordered](sli []T)
- func Insertion[T constraints.Ordered](sli []T)
- func Insertion2[T constraints.Ordered](sli []T)
- func Quick[T constraints.Ordered](sli []T) []T
- func QuickParallel[T constraints.Ordered](sli []T) []T
- func Selection[T constraints.Ordered](sli []T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Insertion ¶
func Insertion[T constraints.Ordered](sli []T)
Insertion 插入排序:将 b区 中的 val 依次插到 a区中 最合适的位置
func Insertion2 ¶
func Insertion2[T constraints.Ordered](sli []T)
Insertion2 插入排序:将 b区 中的 val 依次插到 a区中 最合适的位置
func Quick ¶
func Quick[T constraints.Ordered](sli []T) []T
Quick 快速排序(串行版):
1、先从数列中 取出一个数 作为基准数 val 2、分区过程,将比这个数大的数 全放到它的右边,小于或等于它的数 全放到它的左边 (右找小, 左找大) 3、再对左右区间 重复第二步,直到各区间 只有一个数
func QuickParallel ¶
func QuickParallel[T constraints.Ordered](sli []T) []T
QuickParallel 快速排序(并发版):
1、先从数列中 取出一个数 作为基准数 val 2、分区过程,将比这个数大的数 全放到它的右边,小于或等于它的数 全放到它的左边 (右找小, 左找大) 3、再对左右区间 重复第二步,直到各区间 只有一个数
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.