Simple and Efficient Purely Functional Queues and Deques
نویسنده
چکیده
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 behavior of certain functions on lazy lists.
منابع مشابه
Practical Memory Checkers for Stacks, Queues and Deques
A memory checker for a data structure provides a method to check that the output of the data structure operations is consistent with the input even if the data is stored on some insecure medium. In 8] we present a general solution for all data structures that are based on insert(i; v) and delete(j) commands. In particular this includes stacks, queues, deques (double-ended queues) and lists. Her...
متن کاملAn Efficient Construction Algorithm for a Class of Implicit Double-Ended Priority Queues
Priority queues and double-ended priority queues are fundamental data types in Computer Science, and various data structures have been proposed to implement them. In particular, diamond deques, interval heaps, min-max-pair heaps, and twin-heaps provide implicit structures for double-ended priority queues. Although these heap-like structures are essentially the same when they are presented in an...
متن کاملReal-Time Persistent Queues and Deques with Logic Variables (Declarative Pearl)
We present a Prolog implementation of real-time persistent queues and double-ended queues. Our implementation is inspired by Okasaki’s lazy-functional approach, but relies only on standard Prolog, comprising of the pure subset plus if-then-else constructs to efficiently implement guards and meta-calls for convenience. The resulting data structure is a nice demonstration of the fact that the use...
متن کاملDynamic Memory ABP Work-Stealing
The non-blocking work-stealing algorithm of Arora, Blumofe, and Plaxton (hencheforth ABP work-stealing) is on its way to becoming the multiprocessor load balancing technology of choice in both Industry and Academia. This highly efficient scheme is based on a collection of array-based deques with low cost synchronization among local and stealing processes. Unfortunately, the algorithm’s synchron...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- J. Funct. Program.
دوره 5 شماره
صفحات -
تاریخ انتشار 1995