|
ADS
Algorithms and Data Structures
|
Files | |
| BucketQueue.h | |
| A priority queue for small nonnegative integer keys, beyond the book: a two-level bucket queue, whose outer level is a vector indexed by the first key \( f \) and whose inner one, for each \( f \), a set of LIFO lists, one per second key \( g \). | |
| DaryHeap.h | |
| A \( D \)-ary heap of plain items, beyond the book: the heap of section 10.1 with \( D \) children per node in a vector, the children of the node \( i \) in the places \( D i + 1 , \ldots , D i + D \) [see BinaryTree.h], ordered by a predicate better( a , b ), true if \( a \) must come out before \( b \). | |
| DialQueue.h | |
| A monotone bucket queue with overflow, beyond the book: the queue of Dial on a circular window of \( W \) buckets, \( W \) a power of 2, the keys out of the window in a radix heap [see RadixHeap.h]. | |
| FibonacciHeapPriorityQueue.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a Fibonacci heap, the structure that section 11.5 names and does not describe: insert() and decrease() in \( O( 1 ) \) amortized time, deleteMin() in \( O( \log n ) \), so that the algorithm of Fredman and Tarjan computes the shortest paths in \( O( m + n \log n ) \). | |
| HeapPriorityQueue.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a heap. | |
| IndexedDaryHeap.h | |
| A \( D \)-ary heap of the integers \( [ 0 , n ) \) with keys and decrease-key, beyond the book: the heap of DaryHeap [see DaryHeap.h], whose items are the pairs \( ( \mathit{key} , \mathit{id} ) \) with the key inline, so that a comparison never leaves the heap, and a vector of the places of the ids, which takes the place of the handles of HeapPriorityQueue [see HeapPriorityQueue.h]. | |
| IndexedHeapPair.h | |
| A priority queue of the integers \( [ 0 , n ) \) by a key of selection that also knows the least of a second key, the bound, among the ids it holds, beyond the book: two heaps of IndexedDaryHeap [see IndexedDaryHeap.h] on the same ids, one by the keys and one by the bounds, so that top() is the id of least key and minBound() the least bound in \( O( 1 ) \), and every change, pop() included, is made on both heaps by the places of the id, in \( O( D \log_D s ) \). | |
| LinkedHeapPriorityQueue.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a heap realized as a binary tree with pointers, beyond the book, instead of the vector of section 10.1: the nodes are those of a complete binary tree numbered by levels from 1, and the path from the root to the node \( k \) follows the bits of \( k \) after the leading one, 0 to the left and 1 to the right, so that the last leaf, where insert() adds a node and from where deleteMin() takes the one that replaces the root, is found in \( O( \log n ) \) steps. | |
| ListPriorityQueue.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a list. | |
| LoserTree.h | |
| The tree of losers of a tournament among \( k \) players, the structure of the merge of \( k \) sorted sequences (Knuth 5.4.1; the notes, section 5.1.3, use a heap of \( k \) pairs for the same purpose). | |
| MeldableHeap.h | |
| The randomized meldable heap of Gambin and Malinowski, beyond the book, as section 10.2 of Morin's book presents it: a binary tree, of any shape, in which each item is not smaller than its parent, and whose only operation is the merge of two such trees: the smaller root stays the root, and the other tree is merged, recursively, with one of its two subtrees chosen by a fair coin. | |
| MinMaxHeap.h | |
| Two double-ended priority queues of plain items, beyond the book: the best and the worst item by better( a , b ) (\( a \) before \( b \)) both at hand, both removable in \( O( \log n ) \) time. | |
| MultiwayMerge.h | |
| The engineered merge of \( k \) sorted sequences, beyond the book [see LoserTree.h for the tree of losers of the notes]: FlatLoserTree, the tree of losers with the keys in its nodes, for the merges whose sequences arrive a block at a time, and multiwayMerge(), the merge of \( k \) sorted ranges in memory, by a funnel of binary mergers. | |
| OrderKey.h | |
| The unsigned key of an item whose order is that of an unsigned word, beyond the book, for the queues that compare and sort many items: a number of at most 8 bytes, or a pair of two numbers of at most 8 bytes in all (the pairs of a priority and an item of the heaps), ordered by std::less or std::greater. | |
| PairingHeap.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a pairing heap, beyond the book: the self-adjusting heap of Fredman, Sedgewick, Sleator and Tarjan, the simplest of the heaps with decrease-key and, in the experiments of Stasko and Vitter and of Larkin, Sen and Tarjan, the fastest one with pointers in practice. | |
| PriorityQueue.h | |
| The PRIORITYQUEUE of section 10.1, with decreasing priority, in two concepts. | |
| QueueCustomization.h | |
| The access to the priority queues of the two concepts of section 10.1, whose definitions are in PriorityQueue.h [see PriorityQueue.h, which includes this header], beyond the book: the items of a queue, queue_item_t< Q >, and the operations by which a queue of ADS, of the standard library or of another library is read alike. | |
| RadixHeap.h | |
| A monotone priority queue of integer keys, beyond the book: the radix heap of Ahuja, Mehlhorn, Orlin and Tarjan, in the form with digits of \( B \) bits of their two-level heap. | |
| SequenceHeap.h | |
| The sequence heap of Sanders, beyond the book: a priority queue of plain items for many items, which works on sorted sequences merged in large batches instead of on a tree walked from the root at each operation, so that its memory is read and written in order and the caches see few misses where a heap [see DaryHeap.h] misses at each level of a large tree. | |
| TreePriorityQueue.h | |
| The PRIORITYQUEUE [see PriorityQueue.h] on a tree. | |