#### DMCA

## A Simple Implementation Technique for Priority Search Queues (2001)

### Cached

### Download Links

- [www.cs.bonn.edu]
- [www.informatik.uni-bonn.de]
- [www.cs.bonn.edu]
- [ftp.cs.uu.nl]
- [www.cs.uu.nl]
- [www.informatik.uni-bonn.de]
- [www.cs.bonn.edu]
- DBLP

### Other Repositories/Bibliography

Venue: | Proceedings of the 2001 International Conference on Functional Programming |

Citations: | 10 - 2 self |

### Citations

902 |
The Art of Computer Programming, Volume 3: Sorting and Searching
- KNUTH
- 1973
(Show Context)
Citation Context ... of the binding serves as the split key, which completely determines the structure of the treap. Tournament trees and pennants. Tournament trees and loser trees already appear in Knuth's TAOCP series =-=[13]-=-. The term pennant was coined by Sack and Strothotte [20] to denote topped, perfectly balanced trees (we do not require the trees to be perfectly balanced though). Pennants are widespread: Sack and St... |

426 |
The Art of Computer Programming, Volume 1 (Fundamental Algorithms), 2nd Edition
- Knuth
- 1973
(Show Context)
Citation Context ...nated subtrees become siblings. Figure 7 displays the tree thus obtained. This transformation is an instance of what is known as the natural correspondence between binary trees and forests, see Knuth =-=[12]-=-. To simplify the analysis let us assume that the original trees are perfectly balanced as in our example, so that we have a total number of n 2 n bindings. In this special case we obtain as the resul... |

329 | Functional programming with bananas, lenses, envelopes and barbed wire. In: - Meijer, Fokkinga, et al. - 1991 |

283 | Purely Functional Data Structures.
- Okasaki
- 1999
(Show Context)
Citation Context ...rees to be perfectly balanced though). Pennants are widespread: Sack and Strothotte employ them to design algorithms for splitting and merging heaps in the form of left-complete binary trees, Okasaki =-=[15]-=- uses pennants as a fundamental building block for data structures modelled after number systems, pennants underly binomial heaps [8], and they are useful for analysing red-black trees [7]. Dijkstra's... |

255 |
A dichromatic framework for balanced trees.
- Guibas, Sedgewick
- 1978
(Show Context)
Citation Context ...re h is the height of the tree. This means, in particular, that in order to ensure an overall logarithmic time bound, the number of rotations per update must be bounded by a constant. Red-black trees =-=[6]-=- or 2-3-4 trees [10] satisfy this constraint. On the other hand, AVL trees [2] or weight-balanced trees [1] do not guarantee such a bound. Ironically, Okasaki's elegant functional implementation of re... |

215 |
An algorithm for the organization of information.
- Adelson-Velskii, Landis
- 1962
(Show Context)
Citation Context ...sure an overall logarithmic time bound, the number of rotations per update must be bounded by a constant. Red-black trees [6] or 2-3-4 trees [10] satisfy this constraint. On the other hand, AVL trees =-=[2]-=- or weight-balanced trees [1] do not guarantee such a bound. Ironically, Okasaki's elegant functional implementation of red-black trees [17] also fails to meet this condition. However, for priority se... |

201 |
Priority search trees
- McCreight
- 1985
(Show Context)
Citation Context ...for the bin packing problem. Second, we describe a simple implementation technique for the abstract data type. The standard implementation of priority search queues, McCreight's priority search trees =-=[14]-=-, combines binary search trees and heaps. Unfortunately, balanced search trees and heaps do not go well together. Rotations that are typically used to maintain balance destroy the heap property and re... |

173 | Views: A way for pattern matching to cohabit with data abstraction.
- Wadler
- 1987
(Show Context)
Citation Context ...s, we can fieely choose an underlying balancing schemee illustrate our approach using weight-balanced trees [1]. Third, we would like to promote the use of views. Views have been introduced by Wadlet =-=[23]-=- to relieve the tension between pattern matching and abstraction. Briefly, views allow any type (in particular, any abstract data type) to be viewed as a free data type. We have found views not only u... |

117 | A fold for all seasons. - Sheard, Fegaras - 1993 |

113 |
A unifying look at data structures.
- Vuillemin
- 1980
(Show Context)
Citation Context ...rees support range queries more efficiently. As an aside, priority search trees should not be confused with cartesian trees or treaps, which are also a combination of search trees and priority queues =-=[22]-=-. In a priority search tree each node is labelled with two keys, the key of the binding and an additional split key, whereas in a treap the key of the binding serves as the split key, which completely... |

113 | Haskell 98: A Non-strict, purely functional language. http://www.haskell.org/onlinereport - Peyton-Jones, Hughes - 1999 |

102 | A Data Structure for Manipulating Priority Queues,
- Vuillemin
- 1978
(Show Context)
Citation Context ...original trees are perfectly balanced as in our example, so that we have a total number of n 2 n bindings. In this special case we obtain as the result of the transformation a so-called binomial heap =-=[21]-=-. Now, in a binomial heap with n 2 n elements, we have one node with h subtrees (namely the root), 2 o nodes with h - 1 subtrees, 2snodes with h - 2 subtrees, ..., 2 n 2 nodes with 1 subtree, and 2 ns... |

93 | A new data structure for representing sorted lists.
- Huddleston, Mehlhorn
- 1982
(Show Context)
Citation Context ...of the tree. This means, in particular, that in order to ensure an overall logarithmic time bound, the number of rotations per update must be bounded by a constant. Red-black trees [6] or 2-3-4 trees =-=[10]-=- satisfy this constraint. On the other hand, AVL trees [2] or weight-balanced trees [1] do not guarantee such a bound. Ironically, Okasaki's elegant functional implementation of red-black trees [17] a... |

27 | Views for standard ML
- Okasaki
(Show Context)
Citation Context ...f socalled range queries. Finally, Section 8 reviews related work and Section 9 concludes. 2. PRELIMINARIES: VIEWS The code in this paper is given in Haskell 98 [19] augmented by the concept of views =-=[4, 16]-=-. This section briefly reviews Okasaki's proposal for views [16]. A view allows any type to be viewed as a ftee data type. A view declaration for a type T consists of an anonymous data type, the view ... |

25 | Breadth-first numbering: lessons from a small exercise in algorithm design. - Okasaki - 2000 |

12 |
A logarithmic implementation of flexible arrays. Memorandum MR83/4
- Braun, Rem
- 1983
(Show Context)
Citation Context ...{o, 2))s({z, )s{J, )))s(({, 3)s{, 7))s({, )s{ v, s))), which in turn evaluates to the tree of Figure 4. In general, the expression tree generated by foldm takes the form of a leaf-oriented Braun tree =-=[3]-=-. Since '' preserves the shape of the expression tree, the priority search pennant produced by from-ord-list corresponds to a topped Braun tree. This means, in particular, that the shape is solely det... |

12 |
Functional pearls: Efficient sets–a balancing act
- Adams
- 1993
(Show Context)
Citation Context ...d-black trees (Guibas & Sedgewick, 1978) or 2-3-4 trees (Huddleston & Mehlhorn, 1982) satisfy this constraint. On the other hand, AVL trees (Adel’son-Vel’skiĭ & Landis, 1962) or weightbalanced tr=-=ees (Adams, 1993) -=-do not guarantee such a bound. Ironically, Okasaki’s elegant functional implementation of red-black trees (1999) also fails to meet this condition. However, for priority search pennants we can freel... |

10 | Constructing red-black trees
- Hinze
- 1999
(Show Context)
Citation Context ...s, Okasaki [15] uses pennants as a fundamental building block for data structures modelled after number systems, pennants underly binomial heaps [8], and they are useful for analysing red-black trees =-=[7]-=-. Dijkstra's algorithm. Using priority search queues we were able to implement Dijkstra's single-source shortest-paths algorithm in a purely functional way. Previous formulations like that of King [11... |

9 |
P.: Views: an extension to Haskell pattern matching. Available from http://www.haskell.org/ development/views.html
- Burton, Meijer, et al.
- 1996
(Show Context)
Citation Context ...f socalled range queries. Finally, Section 8 reviews related work and Section 9 concludes. 2. PRELIMINARIES: VIEWS The code in this paper is given in Haskell 98 [19] augmented by the concept of views =-=[4, 16]-=-. This section briefly reviews Okasaki's proposal for views [16]. A view allows any type to be viewed as a ftee data type. A view declaration for a type T consists of an anonymous data type, the view ... |

7 |
Functional Pearls: Efficient sets – a balancing act
- Adams
- 1993
(Show Context)
Citation Context ...tant time operations without sacrificing the running time of the priority queue methods. Thus, we can fieely choose an underlying balancing schemee illustrate our approach using weight-balanced trees =-=[1]-=-. Third, we would like to promote the use of views. Views have been introduced by Wadlet [23] to relieve the tension between pattern matching and abstraction. Briefly, views allow any type (in particu... |

7 |
A characterization of heaps and its applications
- Sack, Strothotte
- 1990
(Show Context)
Citation Context ... determines the structure of the treap. Tournament trees and pennants. Tournament trees and loser trees already appear in Knuth's TAOCP series [13]. The term pennant was coined by Sack and Strothotte =-=[20]-=- to denote topped, perfectly balanced trees (we do not require the trees to be perfectly balanced though). Pennants are widespread: Sack and Strothotte employ them to design algorithms for splitting a... |

6 |
A log log n data structure for three-sided range queries
- Fries, Mehlhorn, et al.
- 1987
(Show Context)
Citation Context ...mes linear as r approaches n. Let us conclude the section by noting that priority search pennants answer range queries less eciently than priority search trees, which support them in (log n + r) time =-=[5]-=-. The reason is simply that the heap property is stronger than the semi-heap property: in the case of binary heaps at most two additional elements must be checked for every element that enters the out... |

6 |
Functional Programming and Graph Algorithms
- King
- 1996
(Show Context)
Citation Context ...[7]. Dijkstra's algorithm. Using priority search queues we were able to implement Dijkstra's single-source shortest-paths algorithm in a purely functional way. Previous formulations like that of King =-=[11]-=- relied in an essential way on stateful computations. King writes: ... if a purely function solution exists for these algorithms [Dijkstra's and Kruskal's] it will probably involve using a state-encap... |

6 |
Functional pearl: Red-black trees in a functional setting
- Okasaki
- 1999
(Show Context)
Citation Context ...s [10] satisfy this constraint. On the other hand, AVL trees [2] or weight-balanced trees [1] do not guarantee such a bound. Ironically, Okasaki's elegant functional implementation of red-black trees =-=[17]-=- also fails to meet this condition. However, for priority search pennants we can fi'eely choose an underlying balancing scheme. We pick Adams's weightbalanced trees [1] since they support insertions a... |

5 | Functional Pearl: Explaining binomial heaps
- Hinze
- 1999
(Show Context)
Citation Context ...y heaps at most two additional elements must be checked for every element that enters the output list. As an aside, this also shows that binomial heaps, which are essentially sequences of semi-heaps (=-=Hinze, 1999b)-=-, are less well-suited for answering range queries. 8 Related work Priority search queues We have already commented on the relationship between priority search pennants and McCreight’s priority sear... |

2 |
Constructing red-black trees. Okasaki, C. (ed
- Hinze
- 1999
(Show Context)
Citation Context ...y heaps at most two additional elements must be checked for every element that enters the output list. As an aside, this also shows that binomial heaps, which are essentially sequences of semi-heaps (=-=Hinze, 1999b)-=-, are less well-suited for answering range queries. 8 Related work Priority search queues We have already commented on the relationship between priority search pennants and McCreight’s priority sear... |

2 |
A new data structure for representing sorted lists, Acta Informatica 17
- Huddleston, Mehlhorn
- 1982
(Show Context)
Citation Context ... in particular, that in order to ensure an overall logarithmic time bound, the number of rotations per update must be bounded by a constant. Red-black trees (Guibas & Sedgewick, 1978) or 2-3-4 trees (=-=Huddleston & Mehlhorn, 1982) satis-=-fy this constraint. On the other hand, AVL trees (Adel’son-Vel’skiĭ & Landis, 1962) or weightbalanced trees (Adams, 1993) do not guarantee such a bound. Ironically, Okasaki’s elegant functional... |

2 | Functional Pearls: E#cient sets---a balancing act - Adams - 1993 |

2 | A logarithmic implementation of arrays. Memorandum MR83/4 - Braun - 1983 |

1 |
Functional Pearh Explaining binomial heaps
- Hinze
- 1999
(Show Context)
Citation Context ...ary heaps at most two additional elements must be checked for every element that enters the output list. As an aside, this also shows that binomial heaps, which are essentially sequences of semiheaps =-=[8]-=-, are less well-suited for answering range queries. 8. RELATED WORK Priority search queues. We have already commented on the relationship between priority search pennants and McCreight's priority sear... |

1 |
Breadth-first numbering: lessons fi'om a small exercise in algorithm design
- Okasaki
- 2000
(Show Context)
Citation Context ...er [23]. Later the idea was fleshed out into a proposal for an extension to Haskell [4]. Okasaki slightly simplified the proposal and adapted it to Standard ML [16]. A recent paper by the same author =-=[18]-=-, where Okasaki strongly advocates the use of views, revived my interest in this language feature. 9. CONCLUSION Priority search queues are an amazing combination of finite maps and priority queues in... |

1 |
editors. Haskell 93 A Non-strict, Purely Functional Language
- Jones, Hughes
- 1999
(Show Context)
Citation Context .... Section 7 analyses the running time of socalled range queries. Finally, Section 8 reviews related work and Section 9 concludes. 2. PRELIMINARIES: VIEWS The code in this paper is given in Haskell 98 =-=[19]-=- augmented by the concept of views [4, 16]. This section briefly reviews Okasaki's proposal for views [16]. A view allows any type to be viewed as a ftee data type. A view declaration for a type T con... |

1 |
A Simple Implementation Technique for Priority Search Queues 25
- McCreight
- 1985
(Show Context)
Citation Context ...example, Doaitse has to play with Johan to determine the second-best player of the first halve of the tournament. Pursuing this idea further leads to a data structure known as a priority search tree (=-=McCreight, 1985-=-). We will come back to this data structure in Sections 7 and 8. An alternative possibility, which we will investigate in this section, is to label eachs8 R. Hinze internal node with the loser of the ... |

1 |
Views for Standard ML. The 1998
- Okasaki
- 1998
(Show Context)
Citation Context ...the implementation are listed in Appendix A. 2 Preliminaries: views The code in this paper is given in Haskell 98 (Peyton Jones & Hughes, 1999) augmented by the concept of views (Burton et al., 1996; =-=Okasaki, 1998b)-=-. This section briefly reviews Okasaki’s proposal for views (1998b). A view allows any type to be viewed as a free data type. A view declaration for a type T consists of an anonymous data type, the ... |

1 | A characterization of heaps and its applications. Information and Computation 86(1):69–86 - Sack, Strothotte - 1990 |

1 |
Data Structures, Algorithms, and Performance. Addison-Wesley Publishing Company. A Auxiliary types and functions This appendix lists auxiliary types and functions used in the paper. All of them with the notable exception of foldm are predefined in Haskell
- Wood
- 1993
(Show Context)
Citation Context ...defined guard :: Bool → [a ] → [a ] guard False as = [ ] guard True as = as. Note that the implementation can be improved by specializing at-most-range to semi-infinite key ranges, see, for instan=-=ce (Wood, 1993-=-). The query functions are analysed in Section 7.sA Simple Implementation Technique for Priority Search Queues 17 6 A balanced scheme One of the strengths of priority search pennants as compared to pr... |