varrayversion

Resizable arrays with fast insertion/deletion

  • O(1) constant time for random access arr.(i) and updates arr.(i) <- v
  • O(1) amortized for push_front and pop_front, push_back and pop_back to add or remove an element to the start or the end
  • O(sqrt N) for insert_at arr i x and delete_at arr i to insert or delete an element anywhere else

This datastructure was invented by Goodrich and Kloss and is described in their paper "Tiered Vectors: Efficient Dynamic Arrays for Rank-Based Sequences".

AuthorArthur Wendling
LicenseMIT
Published
Homepagehttps://github.com/art-w/varray
Issue Trackerhttps://github.com/art-w/varray/issues
Maintainerart.wendling@gmail.com
Dependencies
Source [http] https://github.com/art-w/varray/archive/refs/tags/0.2.tar.gz
md5=1adc5c68c7b65f43ab6436400ea2647b
sha512=0899d2db1692c8800320991492744dd3d9a297c40d1842cf3fcd29aa4da66c713127c315886c4b1f915725f5e28953bcbbbc2534c234a25227eeae86f5ffc08c
Edithttps://github.com/ocaml/opam-repository/tree/master/packages/varray/varray.0.2/opam
No package is dependent