https://github.com/golang-infrastructure/go-bogo-sort
猴子排序
https://github.com/golang-infrastructure/go-bogo-sort
joke sorting-algorithms
Last synced: 3 months ago
JSON representation
猴子排序
- Host: GitHub
- URL: https://github.com/golang-infrastructure/go-bogo-sort
- Owner: golang-infrastructure
- License: mit
- Created: 2022-12-09T03:29:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-15T15:32:33.000Z (over 2 years ago)
- Last Synced: 2025-01-18T16:11:04.723Z (5 months ago)
- Topics: joke, sorting-algorithms
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 猴子排序(Monkey Sort)
注意:本项目只是一个玩笑性质的项目,所使用的的排序算法也不适合用于生产环境!
# 一、安装
```bash
go get -u github.com/golang-infrastructure/go-monkey-sort
```# 二、示例代码
```go
package mainimport (
"fmt"
monkey_sort "github.com/golang-infrastructure/go-monkey-sort"
)func main() {
slice := []int{2, 3, 1, 4}
count := monkey_sort.Sort(slice)
fmt.Println(count)
fmt.Println(slice)
// Output:
// 4861854
// [1 2 3 4]
}
```