Symantec Interview Question
Senior Software Development EngineersCountry: India
Interview Type: Phone Interview
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
the template definition for hash_map is : template <
class Key,
class Value,
class HashKey = Self<Key>,
class EqualKey = EqualTo<Key>,
class LessKey = Less<Key>,
class Alloc = DefaultAllocator<Pair<const Key, Value>
for HashKey, that is for converting Key into bucket index. EqualKey is try to compare to key to check whether occur collision. But for LessKey I guess for some implementation such as Red-Black tree or AVL, it is useful.
Very embarrassed for duplicate submission, because just happened a problem when submitting, but I do not know how to delete.....
- will April 05, 2013