]> gitweb.factorcode.org Git - factor.git/blob - basis/assoc-heaps/assoc-heaps-docs.factor
Conflict resolution
[factor.git] / basis / assoc-heaps / assoc-heaps-docs.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.markup help.syntax io.streams.string assocs
4 heaps.private ;
5 IN: assoc-heaps
6
7 HELP: <assoc-heap>
8 { $values { "assoc" assoc } { "heap" heap } { "assoc-heap" assoc-heap } }
9 { $description "Constructs a new " { $link assoc-heap } " from two existing data structures." } ;
10
11 HELP: <unique-max-heap>
12 { $values { "unique-heap" assoc-heap } }
13 { $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a max-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ;
14
15 HELP: <unique-min-heap>
16 { $values { "unique-heap" assoc-heap } }
17 { $description "Creates a new " { $link assoc-heap } " where the assoc is a hashtable and the heap is a min-heap. Popping an element from the heap leaves this element in the hashtable to ensure that the element will not be processed again." } ;
18
19 { <unique-max-heap> <unique-min-heap> } related-words
20
21 HELP: assoc-heap
22 { $description "A data structure containing an assoc and a heap to get certain properties with better time constraints at the expense of more space and complexity. For instance, a hashtable and a heap can be combined into one assoc-heap to get a sorted data structure with O(1) lookup. Operations on assoc-heap may update both the assoc and the heap or leave them out of sync if it's advantageous." } ;
23
24 ARTICLE: "assoc-heaps" "Associative heaps"
25 "The " { $vocab-link "assoc-heaps" } " vocabulary combines exists to synthesize data structures with better time properties than either of the two component data structures alone." $nl
26 "Associative heap constructor:"
27 { $subsection <assoc-heap> }
28 "Unique heaps:"
29 { $subsection <unique-min-heap> }
30 { $subsection <unique-max-heap> } ;
31
32 ABOUT: "assoc-heaps"