https://leetcode-cn.com/problems/two-sum/
https://leetcode-cn.com/problems/repeated-dna-sequences/
https://leetcode-cn.com/problems/contains-duplicate/submissions/
https://leetcode-cn.com/problems/ransom-note/submissions/
------------恢复内容开始------------
https://blog.csdn.net/qq_30815237/article/details/91047041?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param
散列技术是在记录的存储位置和它的关键字之间建立一个确定的关系,每一个关键字key对应一个存储位置adr=f(key)
hash table--利用散列技术奖记录存储在一块连续的存储空间
map--映射是指两个集合之间的元素的相互对应关系
特点:增加和删除节点对迭代器影响很小,对于迭代器来说可以修改实值,而不能修改key
insert(pair<string,int>(tom,1)) ---- insert() 插入一个新的映射,参数是一个pair类型
count(val) ---返回的是被查找元素的个数
find() ----返回查找元素的位置,没有则返回map.end() (map.end()不指向最后一个元素,而是指向最后一个元素+1)
unordered_map ---以key来查找value,不会根据key排序
结论:如果需要内部元素自动排序,使用map,不需要排序使用unordered_map
https://leetcode-cn.com/problems/two-sum/
https://leetcode-cn.com/problems/repeated-dna-sequences/
https://leetcode-cn.com/problems/contains-duplicate/submissions/
https://leetcode-cn.com/problems/ransom-note/submissions/
------------恢复内容结束------------