1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
6 <meta name=
"generator" content=
7 "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
9 <title>Examples
</title>
10 <meta http-equiv=
"Content-Type" content=
11 "text/html; charset=us-ascii" />
16 <h1>Associative-Container Examples
</h1>
18 <h2><a name=
"basic_usage" id=
"basic_usage">Basic Use
</a></h2>
22 "../../../../testsuite/ext/pb_ds/example/basic_map.cc"><tt>basic_map.cc
</tt></a>
23 Basic use of
"maps".
</li>
26 "../../../../testsuite/ext/pb_ds/example/basic_set.cc"><tt>basic_set.cc
</tt></a>
27 Basic use of
"sets".
</li>
30 "../../../../testsuite/ext/pb_ds/example/erase_if.cc"><tt>erase_if.cc
</tt></a>
31 Conditionally erasing values from a container object.
</li>
34 <h2><a name=
"generics" id=
"generics">Generics
</a></h2>
38 "../../../../testsuite/ext/pb_ds/example/assoc_container_traits.cc"><tt>assoc_container_traits.cc
</tt></a>
40 "assoc_container_traits.html"><tt>container_traits
</tt></a> to query
41 about underlying data structure behavior.
</li>
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>
49 <h2><a name=
"hash_based" id=
"hash_based">Hash-Based
53 <h3><a name=
"resize_related" id=
"resize_related">Resize
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
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>
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>
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
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
83 <h3><a name=
"hash_related" id=
"hash_related">Hash-Function
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>
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>
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>
103 "../../../../testsuite/ext/pb_ds/example/ranged_hash.cc"><tt>ranged_hash.cc
</tt></a>
104 Writing a ranged-hash functor.
</li>
107 <h2><a name=
"tree_like_based" id=
108 "tree_like_based">Tree-Like Containers (Trees and
112 <h3><a name=
"node_invariants" id=
113 "node_invariants">Node-Invariants
</a></h3>
118 "../../../../testsuite/ext/pb_ds/example/tree_order_statistics.cc"><tt>tree_order_statistics.cc
</tt></a>
119 Using trees for order statistics.
</li>
122 "../../../../testsuite/ext/pb_ds/example/tree_intervals.cc"><tt>tree_intervals.cc
</tt></a>
123 Augmenting trees to support operations on line
127 <h3><a name=
"split_join" id=
"split_join">Split and
133 "../../../../testsuite/ext/pb_ds/example/tree_join.cc"><tt>tree_join.cc
</tt></a>
134 Joining two tree-based container objects.
</li>
137 "../../../../testsuite/ext/pb_ds/example/trie_split.cc"><tt>trie_split.cc
</tt></a>
138 Splitting a PATRICIA trie container object.
</li>
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
146 <h2><a name=
"trie_based" id=
"trie_based">Trie-Based
152 "../../../../testsuite/ext/pb_ds/example/trie_dna.cc"><tt>trie_dna.cc
</tt></a>
153 Using a PATRICIA trie for DNA strings.
</li>
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>
161 <h2><a name=
"mmaps" id=
"mmaps">"Multimaps" and
162 "Multisets".
</a></h2>
165 "../../../../testsuite/ext/pb_ds/example/basic_multimap.cc"><tt>basic_multimap.cc
</tt></a>
166 Basic use of
"multimaps".
</li>
169 "../../../../testsuite/ext/pb_ds/example/basic_multiset.cc"><tt>basic_multiset.cc
</tt></a>
170 Basic use of
"multisets".
</li>