toyama1710 blog posts tags categories

永続weight-biased lefitst heap書いた

categories:


PersistentLeftistHeapのドキュメント

LeftistHeapの永続化実装になってる

インタフェース

Self merge_with(Self h)

hとマージしてできたヒープを返す $\Omicron(\log N)$

Self push(T v)

vを追加したヒープを返す $\Omicron(\log N)$

Self pop()

最小値を削除したヒープを返す $\Theta(1)$

int size()

ヒープに格納されている要素数 $\Theta(1)$

bool empty()

ヒープが空か? $\Theta(1)$