Skip to main content

Module persistent_vector

Module persistent_vector 

Source
Expand description

Persistent vector based on Relaxed Radix Balanced (RRB) trees.

An immutable, persistent vector where every “mutation” returns a new vector while sharing unchanged structure with previous versions via Arc.

§Complexity

OperationTime
get(index)O(log₃₂ N)
set(i, v)O(log₃₂ N)
push_backO(1) amortised
concatO(log₃₂ N)
sliceO(log₃₂ N)
lenO(1)

§Structural Sharing

Old versions remain valid after modification — they share subtrees with new versions through Arc.

Structs§

PersistentRrbVec
A persistent vector based on Relaxed Radix Balanced (RRB) trees.
PersistentRrbVecIter
Iterator over elements of a PersistentRrbVec.