btreeset
目的
BTreeSet<.T>を提供 し、new/insert/contains/remove/len/clear/freeの bare 名で扱 えるようにします。要素 の比較 はOrdtrait に委譲 し、i32固定の collection から脱却 します。
実装
名前 はBTreeSetですが、実体 は整列済 み key配列 です。検索 は lower_bound、挿入 /削除 は shift で実装 します。
注意
本物 の B-tree ではありません。Ordimpl が全順序 を満 たすことを前提 にします。
計算量
containsは O(log n)、insert/removeは O(n) です。
BTreeSet
new
BTreeSet<.T> を
len
contains
key の
insert
key を
remove
key を