A fast algorithm for copying list structures
- 1 May 1978
- journal article
- Published by Association for Computing Machinery (ACM) in Communications of the ACM
- Vol. 21 (5) , 351-357
- https://doi.org/10.1145/359488.359491
Abstract
An algorithm is presented for copying an arbitrarily linked list structure into a block of contiguous storage locations without destroying the original list. Apart from a fixed number of program variables, no auxillary storage, such as a stack, is used. The algorithm needs no mark bits and operates in linear time. It is shown to be significantly faster than Fisher's algorithm, the fastest previous linear-time algorithm for the same problem. Its speed comes mainly from its efficient list-traversal technique, which folds the processing stack into the structure being built, and from its classification of list cells into nine types, which enables processing operations to be optimized for each type.Keywords
This publication has 8 references indexed in Scilit:
- A bounded storage algorithm for copying cyclic structuresCommunications of the ACM, 1977
- An empirical study of list structure in LispCommunications of the ACM, 1977
- An efficient list-moving algorithm using constant workspaceCommunications of the ACM, 1976
- Copying cyclic list structures in linear time using bounded workspaceCommunications of the ACM, 1975
- Copying list structures using bounded workspaceCommunications of the ACM, 1974
- A nonrecursive list compacting algorithmCommunications of the ACM, 1970
- An efficient machine-independent procedure for garbage collection in various list structuresCommunications of the ACM, 1967
- Recursive functions of symbolic expressions and their computation by machine, Part ICommunications of the ACM, 1960