isort

package
v0.0.0-...-30b7a66 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyArr

func CopyArr(arr []int) []int

func GenerateNearlyOrderedArray

func GenerateNearlyOrderedArray(n, swapTimes int) []int

func GenerateRandomArray

func GenerateRandomArray(n, min, max int) []int

func InsertionSort

func InsertionSort(list []int) []int

* InsertionSort: 插入排序 前置的元素已经排好序, 每次从最后一个排好序的元素的下一位开始, 往前比较, 将元素插入相应的位置

func IsSorted

func IsSorted(arr []int) bool

func MergeSort

func MergeSort(list []int) []int

func MergeSort_2

func MergeSort_2(list []int) []int

func QuickSort

func QuickSort(list []int) []int

* QuickSort: 每次找一个标定点(随机下标), 将数组划分为两部分, 左边<=标点定, 右边>=标定点 然后再对标定点的两侧分别进行相同的操作

func RandomInt

func RandomInt(start, end int, includeEnd bool) int

randomInt, [start, end]/ [start, end)

func TestSort

func TestSort(sortName string, f func([]int) []int, arr []int)

func ThreeWayQuickSort

func ThreeWayQuickSort(list []int) []int

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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