Purely functional, real-time deques with catenation

We describe an efficient, purely functional implementation of deques with catenation. In addition to being an intriguing problem in its own right, finding a purely functional implementation of catenable deques is required to add certain sophisticated programming constructs to functional programming languages. Our solution has a worst-case running time of <italic>O</italic>(1) for each push, pop, inject, eject and catenation. The best previously known solution has an <italic>O</italic>(log<supscrpt>*</supscrpt><italic>k</italic>) time bound for the <italic>k</italic>th deque operation. Our solution is not only faster but simpler. A key idea used in our result is an algorithmic technique related to the redundant digital representations used to avoid carry propagation in binary counting.

[1]  Rob R. Hoogerwoord,et al.  Functional Pearls A symmetric set of efficient list operations , 1992, Journal of Functional Programming.

[2]  Robert E. Tarjan,et al.  Confluently persistent deques via data structuaral bootstrapping , 1993, SODA '93.

[3]  Jeffrey D. Ullman,et al.  A programming and problem solving seminar. , 1991 .

[4]  Robert Todd Hood,et al.  The Efficient Implementation of Very-high-level Programming Language Constructs , 1982 .

[5]  Robert HOOD,et al.  Real-Time Queue Operation in Pure LISP , 1980, Inf. Process. Lett..

[6]  Arnold L. Rosenberg,et al.  Real-Time Simulation of Multihead Tape Units , 1972, JACM.

[7]  Haim Kaplan,et al.  Purely functional representations of catenable sorted lists , 1996, STOC '96.

[8]  Donald E. Knuth,et al.  A Programming and Problem-Solving Seminar , 1981 .

[9]  Gregory F. Johnson,et al.  Stores and partial continuations as first-class objects in a language and its environment , 1988, POPL '88.

[10]  F. Warren Burton,et al.  An Efficient Functional Implementation of FIFO Queues , 1982, Information Processing Letters.

[11]  M. H. Overmars,et al.  Searching in the past I , 1981 .

[12]  John A. Allen,et al.  The anatomy of lisp , 1980 .

[13]  Chris Okasaki,et al.  Simple and efficient purely functional queues and deques , 1995, Journal of Functional Programming.

[14]  David P. Dobkin,et al.  Efficient uses of the past , 1980, 21st Annual Symposium on Foundations of Computer Science (sfcs 1980).

[15]  Haim Kaplan Purely functional lists , 1997 .

[16]  Benjamin Goldberg,et al.  Real-time deques, multihead Turing machines, and purely functional programming , 1993, FPCA '93.

[17]  Matthias Felleisen,et al.  Abstract continuations: a mathematical semantics for handling full jumps , 1988, LISP and Functional Programming.

[18]  Robert E. Tarjan,et al.  Fully persistent lists with catenation , 1991, SODA '91.

[19]  S. Rao Kosaraju,et al.  An optimal RAM implementation of catenable min double-ended queues , 1994, SODA '94.

[20]  Chris Okasaki,et al.  Catenable double-ended queues , 1997, ICFP '97.

[21]  Donald E. Knuth,et al.  The Art of Computer Programming, Volumes 1-3 Boxed Set , 1998 .

[22]  Richard Cole,et al.  Searching and Storing Similar Lists , 2018, J. Algorithms.

[23]  Robert E. Tarjan,et al.  Data-Structural Bootstrapping, Linear Path Compression, and Catenable Heap-Ordered Double-Ended Queues , 1995, SIAM J. Comput..

[24]  Matthias Felleisen,et al.  The theory and practice of first-class prompts , 1988, POPL '88.

[25]  Haim Kaplan,et al.  Persistent lists with catenation via recursive slow-down , 1995, STOC '95.

[26]  Robert E. Tarjan,et al.  Planar point location using persistent search trees , 1986, CACM.

[27]  Gerth Stølting Brodal,et al.  Worst-case efficient priority queues , 1996, SODA '96.

[28]  Joachim Laubsch Review of "The Anatomy of LISP by John Allen," McGRAW HILL, New York, 1977 , 1978, LISPB.

[29]  Chris Okasaki,et al.  Amortization, lazy evaluation, and persistence: lists with catenation via lazy linking , 1995, Proceedings of IEEE 36th Annual Foundations of Computer Science.

[30]  S. Rao Kosaraju,et al.  Real-time simulation of concatenable double-ended queues by double-ended queues (Preliminary Version) , 1979, STOC.

[31]  Robert E. Tarjan,et al.  Deques with Heap Order , 1986, Inf. Process. Lett..

[32]  R. Tarjan Amortized Computational Complexity , 1985 .

[33]  Lawrence Robinson,et al.  An example of hierarchical design and proof , 1978, CACM.

[34]  Haim Kaplan,et al.  Simple Confluently Persistent Catenable Lists (Extended Abstract) , 1998, SWAT.

[35]  Robert E. Tarjan,et al.  Data structural bootstrapping, linear path compression, and catenable heap ordered double ended queues , 1992, Proceedings., 33rd Annual Symposium on Foundations of Computer Science.

[36]  Robert E. Tarjan,et al.  Making data structures persistent , 1986, STOC '86.

[37]  Jan van Leeuwen,et al.  Worst-case Analysis of Set Union Algorithms , 1984, JACM.

[38]  Matthias Felleisen,et al.  Control delimiters and their hierarchies , 1990, LISP Symb. Comput..

[39]  Greg N. Frederickson,et al.  An Optimal Algorithm for Selection in a Min-Heap , 1993, Inf. Comput..

[40]  Bernard Chazelle,et al.  How to Search in History , 1983, Inf. Control..

[41]  Joel I. Seiferas,et al.  New Real-Time Simulations of Multihead Tape Units , 1977, JACM.

[42]  Chris Okasaki,et al.  Purely functional data structures , 1998 .

[43]  Gerth St lting Brodaly Worst-case Eecient Priority Queues , 1996 .

[44]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.

[45]  Paul F. Dietz Fully Persistent Arrays (Extended Array) , 1989, WADS.