Learn More
When a C programmer needs an efficient data structure for a particular problem , he or she can often simply look one up in any of a number of good textbooks or handbooks. Unfortunately, programmers in functional languages such as Standard ML or Haskell do not have this luxury. Although some data structures designed for imperative languages such as C can be(More)
Amortization has been underutilized in the design of persistent data structures, largely because traditional accounting schemes break down in a persistent setting. Such schemes depend on saving \credits" for future use, but a persistent data structure may have multiple \futures", each competing for the same credits. We describe how lazy evaluation can often(More)
In Standard ML, as in many other languages, programmers are often confronted with an unpleasant choice between pattern matching and abstraction. Because pattern matching can only be performed on concrete datatypes, programmers must often sacriice either the convenience of pattern matching or the engineering beneets of abstraction. Views relieve this tension(More)
We present a new data structure, called a random-access 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(More)
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. This paper presents another(More)
Graphs are ubiquitous, finding applications in domains ranging from software engineering to computational biology. While graph theory and graph algorithms are some of the oldest, most studied fields in computer science, the problem of visualizing graphs is comparatively young. This problem, known as graph drawing, is that of transforming combinatorial(More)
This note explicates two styles of lazy programming, showing how one (called \odd") is easy to encode in the tradi-tionaìdelay' and`force' syntax, but forces too much evaluation , while the other (called \even") delays evaluation as in traditional lazy languages, but is harder to encode. It presents a newìazy' syntax, and shows how the even style is easy to(More)