摘要: package main import "fmt" type BPlustree map[int]node //定义 func NewBplusTree() *BPlustree { bt := BPlustree{} //初始化 leaf := NewLeafNode(nil) //叶子节点 r 阅读全文
posted @ 2024-07-20 02:52 爱跑步的乌龟 阅读(4) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math/rand" "time" ) //B树的节点 type BtreeNode struct { Leaf bool //是否叶子 N int //分支的数量 keys []int //存储数据 Children []*BtreeNod 阅读全文
posted @ 2024-07-20 02:50 爱跑步的乌龟 阅读(4) 评论(0) 推荐(0) 编辑
摘要: package main //定义常量红黑 const ( RED = true BLACK = false ) //红黑树结构 type RBNode struct { Left *RBNode //左节点 Right *RBNode //右边节点 Parent *RBNode //父亲节点 Co 阅读全文
posted @ 2024-07-20 02:50 爱跑步的乌龟 阅读(4) 评论(0) 推荐(0) 编辑
摘要: package main import ( "bytes" "container/list" "fmt" "strconv" ) type Node struct { Data int //数据 Left *Node //指向左边节点 Right *Node //指向右边节点 } type Bina 阅读全文
posted @ 2024-07-20 02:49 爱跑步的乌龟 阅读(3) 评论(0) 推荐(0) 编辑
摘要: let gifts = [ { "name":"mac", "prop":1 }, { "name":"红米", "prop":10 }, { "name":"u盘", "prop":40 }, { "name":"香皂", "prop":49 } ]; function getResult(arr 阅读全文
posted @ 2023-01-01 15:22 爱跑步的乌龟 阅读(79) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" func HeapSort(arr []int) []int { length := len(arr) for i := 0; i < length; i++ { lastmesslen := length - i //每次截取一段 HeapSor 阅读全文
posted @ 2022-12-15 12:11 爱跑步的乌龟 阅读(19) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" //11,9,2,8,3,7,4,6,5,10 //9 11 2 8 3 7 4 6 5 10 //9 2 11 8 3 7 4 6 5 10 //9 2 8 11 3 7 4 6 5 10 //9 2 8 3 11 7 4 6 5 10 //9 阅读全文
posted @ 2022-12-15 12:10 爱跑步的乌龟 阅读(29) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math/rand" ) //3,9,2,8,1,7,4,6,5,10 //3 9,2,8,1,7,4,6,5,10 // 2,1 3, 9,2,8,,7,4,6,5,10 // 9,2,8,,7,4,6,5,10 // ,8,7,4,6,5 阅读全文
posted @ 2022-12-15 12:08 爱跑步的乌龟 阅读(54) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" //// 1 9 2 8 7 6 4 5 //// 1 9 2 8 7 6 4 5 //// 1 2 9 8 7 6 4 5 //// 1 2 8 9 7 6 4 5 //// 1 2 7 8 9 6 4 5 //// 1 2 6 7 8 9 4 阅读全文
posted @ 2022-12-15 12:07 爱跑步的乌龟 阅读(14) 评论(0) 推荐(0) 编辑
摘要: import "fmt" // 1 9 2 8 7 6 4 5 //9 1 2 8 7 6 4 5 //9 8 1 2 7 6 4 5 //9 8 7 1 2 6 4 5 func SelectSortMax(arr []int) int { length := len(arr) //数组长度 if 阅读全文
posted @ 2022-12-15 12:05 爱跑步的乌龟 阅读(3) 评论(0) 推荐(0) 编辑