gsort

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

README

go 快速排序的泛型代码实现

支持类型:int | int8 | int16 | int32 | int64 | float32 | float64 | string

其他类型或结构体请使用标准库的 Sort(data Interface) 或者 Slice(x any, less func(i, j int) bool) 实现。

Documentation

Overview

Author: Fu huizhong<fuhuizn@163.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSorted

func IsSorted[T Compareable](s []T) bool

func Sort

func Sort[T Compareable](s []T)

Types

type Compareable

type Compareable interface {
	int | int8 | int16 | int32 | int64 | float32 | float64 | string
}

Jump to

Keyboard shortcuts

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