Abstract:
We present a new data structure, called a random-access list, that supports array lookup and update operations in O(log n) time, while simultaneously providing O(1) time list operations (cons, head, tail). A closer analysis of the array operations improves the bound to O(minfi; log ng) in the worst case and O(log i) in the expected case, where i is the index of the desired element. Empirical evidence suggests that this data structure should be quite efficient in practice. 1 Introduction Lists are the primary data structure in every functional programmer 's toolbox. They are simple, convenient, and usually quite efficient. The main drawback of lists is that accessing the ith element requires O(i) time. In such situations, functional programmers often find themselves longing for the efficient random access of arrays. Unfortunately, arrays can be quite awkward to implement in a functional setting, where previous versions of the array must be available even after an update. Since arra...
Citations
|
1415
|
The Definition of Standard ML
– Milner, Tofte, et al.
- 1990
|
|
1122
|
Introduction to Functional Programming
– Bird, Wadler
- 1988
|
|
338
|
ML for the Working Programmer
– Paulson
- 1991
|
|
217
|
A real-time garbage collector based on the lifetimes of objects
– Lieberman, Hewitt
- 1983
|
|
210
|
Making data structures persistent
– DRISCOLL, SARNAK, et al.
- 1989
|
|
104
|
Views: A way for pattern matching to cohabit with data abstraction
– WADLER
- 1987
|
|
96
|
types can change the world
– Linear
- 1990
|
|
73
|
A data structure for manipulating priority queues
– Vuillemin
- 1978
|
|
54
|
Detecting global variables in denotational specifications
– Schmidt
- 1985
|
|
31
|
Efficient applicative data types
– Myers
- 1984
|
|
29
|
Update analysis and the efficient implementation of functional aggregates
– Bloss
- 1989
|
|
28
|
Fully persistent arrays
– Dietz
- 1989
|
|
27
|
Shallow binding in lisp 1.5
– Baker
|
|
25
|
Pattern Matching with Abstract Data Types
– Burton, Cameron
- 1993
|
|
24
|
River Routing Every Which Way, but Loose
– Cole, Siegel
- 1984
|
|
24
|
Simple and efficient purely functional queues and deques
– Okasaki
- 1995
|
|
24
|
Unrolling lists
– Shao, Reppy, et al.
- 1994
|
|
23
|
Real-time queue operations
– Hood, Melville
- 1981
|
|
22
|
Planar graph decomposition and all pairs shortest paths
– Frederickson
- 1991
|
|
22
|
Persistent lists with catenation via recursive slow-down
– Tarjan
- 1995
|
|
22
|
Localized search in sorted lists
– Kosaraju
- 1981
|
|
21
|
Deques with heap order
– GAJEWSKA, TARJAN
- 1986
|
|
17
|
Order-of-evaluation analysis for destructive updates in strict functional languages with flat aggregates
– Sastry, Clinger
- 1992
|
|
14
|
Abstract value constructors
– Aitken, Reppy
- 1992
|
|
13
|
Shallow binding makes functional arrays fast
– Baker
- 1991
|
|
12
|
An efficiency comparison of some representations of purely functional arrays
– Aasa, Holmstrom, et al.
- 1988
|
|
12
|
An applicative random-access stack
– Myers
- 1983
|
|
11
|
Real-time deques, multihead turing machines, and purely functional programming
– CHUANG, GOLDBERG
- 1993
|
|
9
|
AVL-trees for Localized Search
– Tsakalidis
- 1985
|
|
8
|
A logarithmic implementation of flexible arrays
– Hoogerwoord
- 1992
|
|
8
|
How to make destructive updates less destructive
– Odersky
- 1991
|
|
6
|
Ben-Amram and Zvi Galil. On pointers versus addresses
– Amir
- 1992
|
|
6
|
The efficient implementation of very-high-level programming language constructs
– HOOD
- 1982
|
|
5
|
A randomized implementation of multiple functional arrays
– Chuang
- 1994
|
|
5
|
A Discipline of Programming
– Dijksta
- 1976
|
|
4
|
Computing external farthest neighbors for a simple polygon
– Agarwal, Aggarwal, et al.
- 1991
|