rbtree:Go的红黑树

时间:2021-05-04 02:46:14
【文件属性】:
文件名称:rbtree:Go的红黑树
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-04 02:46:14
Go rbtree 请参阅分支以获取有争议的红黑树。 软件包rbtree实现了“算法简介”中引入的红黑树。 在当前语言规范下,有以下模式可以实现通用容器: 排序包使用的模式 type Interface interface { Compare ( another Interface ) int } 使用回调: func Compare ( x , y interface {}) int 使用go generate生成特定类型的代码。 该程序包使用回调。 使用技巧获取空接口值的指针可以避免数据复制和运行时断言,因此可以大大提高性能。 确保类型安全是您的责任。 // ValuePtr is a helper function to get the pointer to value stored in // empty interface. func ValuePtr (
【文件预览】:
rbtree-master
----walk.go(2KB)
----walk_test.go(1KB)
----iter_test.go(862B)
----rb.go(5KB)
----common.go(1KB)
----tree.go(4KB)
----tree_test.go(2KB)
----README.md(1KB)
----valid_test.go(1KB)
----iter.go(3KB)

网友评论