Copyright | (c) 2021 Xy Ren |
---|---|
License | BSD3 |
Maintainer | xy.r@outlook.com |
Stability | unstable |
Portability | non-portable (GHC only) |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
An efficient vector type, implemented as a radix tree. It has the following time complexities:
- Lookup: \( O(\log n) \)
- Update: \( O(\log n) \)
- Append: \( O(\log n) \)
The branching factor (base of log) is 32 therefore the time is close to constant in most cases. Note that in practice, lookup is faster than update, and update is faster than append.
lookup :: Int -> RadixVec a -> a Source #
Lookup in a RadixVec
by an index. This does not perform any bounds check.