Documentation
¶
Overview ¶
对无序序列进行排序
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BubbleSort ¶
BubbleSort 冒泡排序. data必须实现sort包中的Interface接口
Example ¶
// declare a array // this array must implenet sort.Inerface data := sort.IntSlice{22, 34, 3, 40, 18, 4} BubbleSort(data)
Output:
func QuickSort ¶
QuickSort 快速排序, data必须要实现sort包的Interface接口
Example ¶
// declare a array // this array must implenet sort.Inerface data := sort.IntSlice{22, 34, 3, 40, 18, 4} QuickSort(data)
Output:
func SelectSort ¶
SelectSort 选择排序, data必须实现sort包中的Interface接口
Example ¶
// declare a array // this array must implenet sort.Inerface data := sort.IntSlice{22, 34, 3, 40, 18, 4} SelectSort(data)
Output:
Types ¶
Click to show internal directories.
Click to hide internal directories.