【正文】
pIter != ( ) 。 } // If no match is found for the key, end( ) is returned hm1_RcIter = ( 4 )。 ( Int_Pair ( 3, 30 ) )。s allocation and deallocation of memory. What is hash_map? The hash_map is: ? An associative container, which a variable size container that supports the efficient retrieval of element values based on an associated key value. ? Reversible, because it provides a bidirectional iterator to access its elements ? Hashed, because its elements are grouped into buckets based on the value of a hash function applied to the key values of the elements. ? Unique in the sense that each of its elements must have a unique key. ? A pair associative container, because its element data values are distinct from its key values. ? A template class, because the functionality it provides is generic and so independent of the specific type of data contained as elements or keys. The data types to be used for elements and keys are, instead, specified as parameters in the class template along with the parison function and allocator. Hash_map優(yōu)點(diǎn) ? The main advantage of hashing over sorting is greater efficiency。鍵 key 用于查詢而值 value 包含我們希望使用的數(shù)據(jù)。 deque ? template class Type, class Allocator=allocatorType class deque Header: deque 接口同 vector Deque特點(diǎn) ? 同 vector,支持 [ ], 雙向性 ? 一個(gè) deque 也表示