1 个不稳定版本
| 0.0.1 | 2021 年 12 月 16 日 |
|---|
#9 in #balanced
21KB
541 行
二分键
无限地在两个不同键之间插入。
字符集
+-/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
数字表示:0 ~ 64,中间大小为 32,对应于 T。
用法
LexiconKey 是按字典序排列的
use bisection_key::{LexiconKey}
let k0 = LexiconKey::default(); // defaults to "T"
k0.bisect_beginning()
k0.bisect_end()
let k1 = LexiconKey::new("a").unwrap();
b0.bisect(&k1)
BalancedKey 是另一种尝试,正如所说的,它在 T 附近平衡,就像“平衡三进制”一样,并有自己的 Ord 特性实现
use bisection_key::{BalancedKey}
let k0 = LexiconKey::default(); // defaults to "T"
k0.bisect_beginning()
k0.bisect_end()
let k1 = LexiconKey::new("a").unwrap();
b0.bisect(&k1)
许可证
MIT