共 50 条
Bootstrapping one-sided flexible arrays
被引:0
|作者:
Hinze, R
[1
]
机构:
[1] Univ Bonn, Inst Informat 3, D-53117 Bonn, Germany
关键词:
algorithms;
design;
performance;
purely functional data structures;
flexible arrays;
sub-logarithmic look-up;
mixed-radix number systems;
Haskell;
D O I:
10.1145/583852.581480
中图分类号:
TP31 [计算机软件];
学科分类号:
081202 ;
0835 ;
摘要:
The abstract data type one-sided flexible array, also called random-access list, supports look-up and update of elements and can grow and shrink at one end. We describe a purely functional implementation based on weight-balanced multiway trees that is both simple and versatile. A novel feature of the representation is that the running time of the operations can be tailored to one's needs-even dynamically at array-creation time. In particular, one can trade the running time of look-up operations for the running time of update operations. For instance, if the multiway trees have a fixed degree, the operations take Theta(log n) time, where n is the size of the flexible array. If the degree doubles levelwise, look-up speeds up to Theta(rootlog n) while update slows down to Theta(2(rootlog n)). We show that different tree shapes can be conveniently modelled after mixed-radix number systems.
引用
收藏
页码:2 / 13
页数:12
相关论文