Skip to main content Accessibility help
×
Home
Hostname: page-component-5c569c448b-8lphq Total loading time: 0.244 Render date: 2022-07-05T22:00:35.087Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "useRatesEcommerce": false, "useNewApi": true } hasContentIssue true

Simple and efficient purely functional queues and deques

Published online by Cambridge University Press:  07 November 2008

Chris Okasaki
Affiliation:
School of Computer Science, Carnegie Mellon University, 5000 Forbes Avenue, Pittsburgh, PA 15213, USA (e-mail: cokasaki@cs.cmu.edu)
Rights & Permissions[Opens in a new window]

Abstract

HTML view is not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

We present purely functional implementations of queues and double-ended queues (deques) requiring only O(1) time per operation in the worst case. Our algorithms are considerably simpler than previous designs with the same bounds. The inspiration for our approach is the incremental behaviour of certain functions on lazy lists.

Type
Articles
Copyright
Copyright © Cambridge University Press 1995

References

Abelson, H. and Sussman, G. J. (1985) Structure and Interpretation of Computer Programs. MIT Press.Google Scholar
Burton, F. W. (1982) An efficient functional implementation of FIFO queues. Information Processing Letters, 14(5):205206, July.CrossRefGoogle Scholar
Chuang, T.-R. and Goldberg, B. (1993) Real-time deques, multihead Turing machines, and purely functional programming. In: Proceedings of the Conference on Functional Programming and Computer Architecture,Copenhagen, pp. 289298.Google Scholar
Fischer, P. C., Meyer, A. R. and Rosenberg, A. L. (1972) Real-time simulation of multihead tape units. Journal of the ACM, 19(4):590607, October.CrossRefGoogle Scholar
Gajewska, H. and Tarjan, R. E. (1986) Deques with heap order. Information Processing Letters, 22(4):197200, April.CrossRefGoogle Scholar
Gries, D. (1981) The Science of Programming. Springer-Verlag.CrossRefGoogle Scholar
Hood, R. and Melville, R. (1981) Real-time queue operations in pure Lisp. Information Processing Letters, 13(2):5053, November.CrossRefGoogle Scholar
Hood, R. (1982) The efficient implementation of very-high-level programming language constructs. PhD thesis, Department of Computer Science, Cornell University.Google Scholar
Hoogerwoord, R. R. (1992) A symmetric set of efficient list operations. Journal of Functional Programming, 2(4):505513, October.CrossRefGoogle Scholar
Leong, B. L. and Seiferas, J. I. (1981) New real-time simulations of multihead tape units. Journal of the ACM, 28(1):166180, January.CrossRefGoogle Scholar
Sarnak, N. (1986) Persistent Data Structures. PhD thesis, Department of Computer Sciences, New York University.Google Scholar
Stoß, H.-J. (1970) K-band simulation von k-Kopf-Turing-maschinen. Computing, 6(3):309317.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.
You have Access
37
Cited by

Save article to Kindle

To save this article to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Simple and efficient purely functional queues and deques
Available formats
×

Save article to Dropbox

To save this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Dropbox account. Find out more about saving content to Dropbox.

Simple and efficient purely functional queues and deques
Available formats
×

Save article to Google Drive

To save this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you used this feature, you will be asked to authorise Cambridge Core to connect with your Google Drive account. Find out more about saving content to Google Drive.

Simple and efficient purely functional queues and deques
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *