Open GoogleCodeExporter opened 9 years ago
If you read their short description
(http://www.cs.princeton.edu/courses/archive/fall03/cs528/handouts/Notes%20on%20
Catenable%20Deques.doc), you will see that the deque without concatenation is
much simpler.
The one without concatenation has some interesting properties:
1. As far as I know, it's the simplest tree-based worst-case purely functional
deque. Being tree-like gives it certain structure that allows attaching
monoid-like accumulators to internal nodes like is common with Hize-Patterson
finger trees.
2. It allows O(lg min(i, n-i)) lookup of the ith element, when annotated with
tree sizes.
3. It allows O(1) approximate split, in which a deque can be split into left
and right parts that differ in size by no more than a constant ratio.
The T-M concatenable deque is very interesting, but I just haven't gotten to it
yet. In the meantime, the one that isn't concatenable in O(1) time has some
nice properties of its own.
Original comment by s...@jbapple.com
on 9 Sep 2012 at 2:25
https://github.com/alang9/deque/blob/master/Data/Deque/NonCat.hs provides a working implementation of a Tarjan-Mihaescu deque with full concatenation. Is the type given here just the beginning of the paper up to the first "gotcha" paragraph?
Original issue reported on code.google.com by
david.fe...@gmail.com
on 9 Sep 2012 at 1:13