Results 1  10
of
23
Simple and efficient purely functional queues and deques
 JOURNAL OF FUNCTIONAL PROGRAMMING
, 1995
"... We present purely functional implementations of queues and doubleended 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 certai ..."
Abstract

Cited by 26 (6 self)
 Add to MetaCart
We present purely functional implementations of queues and doubleended 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.
Approximate Matching of RunLength Compressed Strings
 Algorithmica
, 2001
"... We focus on the problem of approximate matching of strings that have been compressed using runlength encoding. Previous studies have concentrated on the problem of computing the longest common subsequence (LCS) between two strings of length m and n, compressed to m runs. We extend an existi ..."
Abstract

Cited by 23 (0 self)
 Add to MetaCart
We focus on the problem of approximate matching of strings that have been compressed using runlength encoding. Previous studies have concentrated on the problem of computing the longest common subsequence (LCS) between two strings of length m and n, compressed to m runs. We extend an existing algorithm for the LCS to the Levenshtein distance achieving O(m m) complexity.
Data Structural Bootstrapping, Linear Path Compression, and Catenable Heap Ordered Double Ended Queues
 SIAM Journal on Computing
, 1992
"... A deque with heap order is a linear list of elements with realvalued keys which allows insertions and deletions of elements at both ends of the list. It also allows the findmin (equivalently findmax) operation, which returns the element of least (greatest) key, but it does not allow a general delet ..."
Abstract

Cited by 19 (7 self)
 Add to MetaCart
(Show Context)
A deque with heap order is a linear list of elements with realvalued keys which allows insertions and deletions of elements at both ends of the list. It also allows the findmin (equivalently findmax) operation, which returns the element of least (greatest) key, but it does not allow a general deletemin (deletemax) operation. Such a data structure is also called a mindeque (maxdeque) . Whereas implementing mindeques in constant time per operation is a solved problem, catenating mindeques in sublogarithmic time has until now remained open. This paper provides an efficient implementation of catenable mindeques, yielding constant amortized time per operation. The important algorithmic technique employed is an idea which is best described as data structural bootstrapping: We abstract mindeques so that their elements represent other mindeques, effecting catenation while preserving heap order. The efficiency of the resulting data structure depends upon the complexity of a special case of pa...
Purely Functional RandomAccess Lists
 In Functional Programming Languages and Computer Architecture
, 1995
"... We present a new data structure, called a randomaccess 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 wor ..."
Abstract

Cited by 18 (2 self)
 Add to MetaCart
(Show Context)
We present a new data structure, called a randomaccess 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...
A Linear Algorithm for Analysis of Minimum Spanning and Shortest Path Trees of Planar Graphs
 Algorithmica
, 1992
"... We give a linear time and space algorithm for analyzing trees in planar graphs. The algorithm can be used to analyze the sensitivity of a minimum spanning tree to changes in edge costs, to find its replacement edges, and to verify its minimality. It can also be used to analyze the sensitivity of a s ..."
Abstract

Cited by 17 (0 self)
 Add to MetaCart
(Show Context)
We give a linear time and space algorithm for analyzing trees in planar graphs. The algorithm can be used to analyze the sensitivity of a minimum spanning tree to changes in edge costs, to find its replacement edges, and to verify its minimality. It can also be used to analyze the sensitivity of a singlesource shortest path tree to changes in edge costs, and to analyze the sensitivity of a minimum cost network flow. The algorithm is simple and practical. It uses the properties of a planar embedding, combined with a heapordered queue data structure. Let G = (V; E) be a planar graph, either directed or undirected, with n vertices and m = O(n) edges. Each edge e 2 E has a realvalued cost cost(e). A minimum spanning tree of a connected, undirected planar graph G is a spanning tree of minimum total edge cost. If G is directed and r is a vertex from which all other vertices are reachable, then a shortest path tree from r is a spanning tree that contains a minimumcost path from r to every...
Purely Functional, RealTime Deques with Catenation
 Journal of the ACM
, 1999
"... We describe an efficient, purely functional implementation of deques with catenation. In addition to being an intriguing problem in its own right, finding a purely functional implementation of catenable deques is required to add certain sophisticated programming constructs to functional programming ..."
Abstract

Cited by 16 (2 self)
 Add to MetaCart
(Show Context)
We describe an efficient, purely functional implementation of deques with catenation. In addition to being an intriguing problem in its own right, finding a purely functional implementation of catenable deques is required to add certain sophisticated programming constructs to functional programming languages. Our solution has a worstcase running time of O(1) for each push, pop, inject, eject and catenation. The best previously known solution has an O(log k) time bound for the k deque operation. Our solution is not only faster but simpler. A key idea used in our result is an algorithmic technique related to the redundant digital representations used to avoid carry propagation in binary counting.
Confluently Persistent Deques via DataStructural Bootstrapping
 J. of Algorithms
, 1993
"... We introduce datastructural bootstrapping, a technique to design data structures recursively, and use it to design confluently persistent deques. Our data structure requires O(log 3 k) worstcase time and space per deletion, where k is the total number of deque operations, and constant worstcase t ..."
Abstract

Cited by 15 (4 self)
 Add to MetaCart
We introduce datastructural bootstrapping, a technique to design data structures recursively, and use it to design confluently persistent deques. Our data structure requires O(log 3 k) worstcase time and space per deletion, where k is the total number of deque operations, and constant worstcase time and space for other operations. Further, the data structure allows a purely functional implementation, with no side effects. This improves a previous result of Driscoll, Sleator, and Tarjan. 1 An extended abstract of this paper was presented at the 4th ACMSIAM Symposium on Discrete Algorithms, 1993. 2 Supported by a Fannie and John Hertz Foundation fellowship, National Science Foundation Grant No. CCR8920505, and the Center for Discrete Mathematics and Theoretical Computer Science (DIMACS) under NSFSTC8809648. 3 Also affiliated with NEC Research Institute, 4 Independence Way, Princeton, NJ 08540. Research at Princeton University partially supported by the National Science Foundatio...
RealTime Deques, Multihead Turing Machines, and Purely Functional Programming
 In Conference on Functional Programming Languages and Computer Architecture
, 1993
"... We answer the following question: Can a deque (double ended queue) be implemented in a purely functional language such that each push or pop operation on either end of a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan [1 ..."
Abstract

Cited by 13 (1 self)
 Add to MetaCart
(Show Context)
We answer the following question: Can a deque (double ended queue) be implemented in a purely functional language such that each push or pop operation on either end of a queue is accomplished in O(1) time in the worst case? The answer is yes, thus solving a problem posted by Gajewska and Tarjan [14] and by Ponder, McGeer, and Ng [25], and refining results of Sarnak [26] and Hoogerwoord [18]. We term such a deque realtime, since its constant worstcase behavior might be useful in real time programs (assuming realtime garbage collection [3], etc.) Furthermore, we show that no restriction of the functional language is necessary, and that push and pop operations on previous versions of a deque can also be achieved in constant time. We present a purely functional implementation of real time deques and its complexity analysis. We then show that the implementation has some interesting implications, and can be used to give a realtime simulation of a multihead Turing machine in a purel...
Simple Confluently Persistent Catenable Lists
 SIAM JOURNAL ON COMPUTING
, 1998
"... We consider the problem of maintaining persistent lists subject to concatenation and to insertions and deletions at both ends. Updates to a persistent data structure are nondestructive  each operation produces a new list incorporating the change, while keeping intact the list or lists to which it a ..."
Abstract

Cited by 12 (2 self)
 Add to MetaCart
We consider the problem of maintaining persistent lists subject to concatenation and to insertions and deletions at both ends. Updates to a persistent data structure are nondestructive  each operation produces a new list incorporating the change, while keeping intact the list or lists to which it applies. Although general techniques exist for making data structures persistent, these techniques fail for structures that are subject to operations, such as catenation, that combine two or more versions. In this paper we develop a simple implementation of persistent doubleended queues with catenation that supports all deque operations in constant amortized time. Our implementation is functional if we allow memoization.
Approximate String Matching with Gaps
, 2002
"... In this paper we consider several new versions of approximate string matching with gaps. The main characteristic of these new versions is the existence of gaps in the matching of a given pattern in a text. Algorithms are sketched for each version and their time and space complexity is stated. The sp ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
In this paper we consider several new versions of approximate string matching with gaps. The main characteristic of these new versions is the existence of gaps in the matching of a given pattern in a text. Algorithms are sketched for each version and their time and space complexity is stated. The specific versions of approximate string matching have various applications in computerized music analysis.