Finger Trees provide a base for implementations of various collection types,
as described in "Finger trees: a simple general-purpose data structure", by
Ralf Hinze and Ross Paterson.
Finger Trees have excellent (amortized) asymptotics:
Access to the first and last elements is O(1).
Appending/prepending a single value is O(1).
Concatenating two trees is (O lg min(l1, l2)) where l1 and l2 are their sizes.
Random access to an element at n is O(lg min(n, l - n)), where
l is the size of the tree.
Constructing a tree with n copies of a value is O(lg n).
Finger Trees provide a base for implementations of various collection types, as described in "Finger trees: a simple general-purpose data structure", by Ralf Hinze and Ross Paterson.
Finger Trees have excellent (amortized) asymptotics:
Access to the first and last elements is O(1). Appending/prepending a single value is O(1). Concatenating two trees is (O lg min(l1, l2)) where l1 and l2 are their sizes. Random access to an element at n is O(lg min(n, l - n)), where l is the size of the tree. Constructing a tree with n copies of a value is O(lg n).