Persistent Stack
(data-structure/persistent_stack.hpp)
Description
永続スタックは,過去のバージョンを保持するスタックである.
空間計算量: $O(m)$, $m$ は変更の数
Operations
-
bool empty()
-
T top()
-
PersistentStack push(T val)
-
val
を先頭に追加する
- 時間計算量: $O(1)$
-
PersistentStack pop()
Reference
Code
Back to top page