xref: /openbsd-src/gnu/gcc/libstdc++-v3/docs/html/ext/pb_ds/assoc_examples.html (revision 404b540a9034ac75a6199ad1a32d1bbc7a0d4210)
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <meta name="generator" content=
7  "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
8
9  <title>Examples</title>
10  <meta http-equiv="Content-Type" content=
11  "text/html; charset=us-ascii" />
12  </head>
13
14<body>
15  <div id="page">
16    <h1>Associative-Container Examples</h1>
17
18    <h2><a name="basic_usage" id="basic_usage">Basic Use</a></h2>
19
20    <ol>
21      <li><a href=
22      "../../../../testsuite/ext/pb_ds/example/basic_map.cc"><tt>basic_map.cc</tt></a>
23      Basic use of "maps".</li>
24
25      <li><a href=
26      "../../../../testsuite/ext/pb_ds/example/basic_set.cc"><tt>basic_set.cc</tt></a>
27      Basic use of "sets".</li>
28
29      <li><a href=
30      "../../../../testsuite/ext/pb_ds/example/erase_if.cc"><tt>erase_if.cc</tt></a>
31      Conditionally erasing values from a container object.</li>
32    </ol>
33
34    <h2><a name="generics" id="generics">Generics</a></h2>
35
36    <ol>
37      <li><a href=
38      "../../../../testsuite/ext/pb_ds/example/assoc_container_traits.cc"><tt>assoc_container_traits.cc</tt></a>
39      Using <a href=
40      "assoc_container_traits.html"><tt>container_traits</tt></a> to query
41      about underlying data structure behavior.</li>
42
43      <li><a href=
44      "../../../../testsuite/ext/pb_ds/example/hash_find_neg.cc"><tt>hash_find_neg.cc</tt></a>
45      A non-compiling example showing wrong use of finding keys in
46      hash-based containers.</li>
47    </ol>
48
49    <h2><a name="hash_based" id="hash_based">Hash-Based
50    Containers</a></h2>
51
52
53    <h3><a name="resize_related" id="resize_related">Resize
54    Related</a></h3>
55
56
57    <ol>
58      <li><a href=
59      "../../../../testsuite/ext/pb_ds/example/hash_initial_size.cc"><tt>hash_initial_size.cc</tt></a>
60      Setting the initial size of a hash-based container
61      object.</li>
62
63      <li><a href=
64      "../../../../testsuite/ext/pb_ds/example/hash_resize_neg.cc"><tt>hash_resize_neg.cc</tt></a>
65      A non-compiling example showing how not to resize a
66      hash-based container object.</li>
67
68      <li><a href=
69      "../../../../testsuite/ext/pb_ds/example/hash_resize.cc"><tt>hash_resize.cc</tt></a>
70      Resizing the size of a hash-based container object.</li>
71
72      <li><a href=
73      "../../../../testsuite/ext/pb_ds/example/hash_illegal_resize.cc"><tt>hash_illegal_resize.cc</tt></a>
74      Showing an illegal resize of a hash-based container
75      object.</li>
76
77      <li><a href=
78      "../../../../testsuite/ext/pb_ds/example/hash_load_set_change.cc"><tt>hash_load_set_change.cc</tt></a>
79      Changing the load factors of a hash-based container
80      object.</li>
81    </ol>
82
83    <h3><a name="hash_related" id="hash_related">Hash-Function
84    Related</a></h3>
85
86
87    <ol>
88      <li><a href=
89      "../../../../testsuite/ext/pb_ds/example/hash_mod.cc"><tt>hash_mod.cc</tt></a>
90      Using a modulo range-hashing function for the case of an
91      unknown skewed key distribution.</li>
92
93      <li><a href=
94      "../../../../testsuite/ext/pb_ds/example/hash_shift_mask.cc"><tt>shift_mask.cc</tt></a>
95      Writing a range-hashing functor for the case of a known
96      skewed key distribution.</li>
97
98      <li><a href=
99      "../../../../testsuite/ext/pb_ds/example/store_hash.cc"><tt>store_hash.cc</tt></a>
100      Storing the hash value along with each key.</li>
101
102      <li><a href=
103      "../../../../testsuite/ext/pb_ds/example/ranged_hash.cc"><tt>ranged_hash.cc</tt></a>
104      Writing a ranged-hash functor.</li>
105    </ol>
106
107    <h2><a name="tree_like_based" id=
108    "tree_like_based">Tree-Like Containers (Trees and
109    Tries)</a></h2>
110
111
112    <h3><a name="node_invariants" id=
113    "node_invariants">Node-Invariants</a></h3>
114
115
116    <ol>
117      <li><a href=
118      "../../../../testsuite/ext/pb_ds/example/tree_order_statistics.cc"><tt>tree_order_statistics.cc</tt></a>
119      Using trees for order statistics.</li>
120
121      <li><a href=
122      "../../../../testsuite/ext/pb_ds/example/tree_intervals.cc"><tt>tree_intervals.cc</tt></a>
123      Augmenting trees to support operations on line
124      intervals.</li>
125    </ol>
126
127    <h3><a name="split_join" id="split_join">Split and
128    Join</a></h3>
129
130
131    <ol>
132      <li><a href=
133      "../../../../testsuite/ext/pb_ds/example/tree_join.cc"><tt>tree_join.cc</tt></a>
134      Joining two tree-based container objects.</li>
135
136      <li><a href=
137      "../../../../testsuite/ext/pb_ds/example/trie_split.cc"><tt>trie_split.cc</tt></a>
138      Splitting a PATRICIA trie container object.</li>
139
140      <li><a href=
141      "../../../../testsuite/ext/pb_ds/example/tree_order_statistics_join.cc"><tt>tree_order_statistics_join.cc</tt></a>
142      Order statistics while joining two tree-based container
143      objects.</li>
144    </ol>
145
146    <h2><a name="trie_based" id="trie_based">Trie-Based
147    Containers</a></h2>
148
149
150    <ol>
151      <li><a href=
152      "../../../../testsuite/ext/pb_ds/example/trie_dna.cc"><tt>trie_dna.cc</tt></a>
153      Using a PATRICIA trie for DNA strings.</li>
154
155      <li><a href=
156      "../../../../testsuite/ext/pb_ds/example/trie_prefix_search.cc"><tt>trie_prefix_search.cc</tt></a>
157      Using a PATRICIA trie for finding all entries whose key
158      matches a given prefix.</li>
159    </ol>
160
161    <h2><a name="mmaps" id="mmaps">"Multimaps" and
162    "Multisets".</a></h2>
163    <ol>
164      <li><a href=
165      "../../../../testsuite/ext/pb_ds/example/basic_multimap.cc"><tt>basic_multimap.cc</tt></a>
166      Basic use of "multimaps".</li>
167
168      <li><a href=
169      "../../../../testsuite/ext/pb_ds/example/basic_multiset.cc"><tt>basic_multiset.cc</tt></a>
170      Basic use of "multisets".</li>
171    </ol>
172  </div>
173</body>
174</html>
175