Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[pull] master from youngyangyang04:master #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
pull merged 20 commits into AlgorithmAndLeetCode:master from youngyangyang04:master
Jul 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
607e4eb
更新 哈希表理论基础 排版格式修复
jinbudaily Jul 19, 2023
c628aa6
更新 0242.有效的字母异位词 排版格式修复
jinbudaily Jul 19, 2023
19dfa98
更新 0349.两个数组的交集 排版格式修复
jinbudaily Jul 19, 2023
764b3e9
更新 0202.快乐数 排版格式修复
jinbudaily Jul 19, 2023
23950d1
更新 001.两数之和 排版格式修复
jinbudaily Jul 19, 2023
2948791
更新 0454.四数相加II 排版格式修复
jinbudaily Jul 19, 2023
0922ede
更新 0383.赎金信 排版格式修复
jinbudaily Jul 19, 2023
eb2cdf2
更新 0015.三数之和 排版格式修复
jinbudaily Jul 19, 2023
3fe673d
更新 0018.四数之和 排版格式修复
jinbudaily Jul 19, 2023
ddee6ad
更新 哈希表总结 排版格式修复
jinbudaily Jul 19, 2023
4ae8843
Merge branch 'master' of github.com:jinbudaily/leetcode-master
jinbudaily Jul 19, 2023
00ef608
更新 0344.反转字符串 排版格式修复
jinbudaily Jul 19, 2023
5cb2501
更新 0541.反转字符串 排版格式修复
jinbudaily Jul 19, 2023
963eb8f
更新 剑指Offer05.替换空格 排版格式修复
jinbudaily Jul 19, 2023
e70ca92
更新 0151.反转字符串中的单词 排版格式修复
jinbudaily Jul 19, 2023
370a4d1
更新 剑指Offer58-II.左旋转字符串 排版格式修复
jinbudaily Jul 19, 2023
5acebcc
更新 0028.实现strStr 排版格式修复
jinbudaily Jul 19, 2023
202dd38
更新 0459.重复的字符串 排版格式修复
jinbudaily Jul 19, 2023
4fe1f08
更新 字符串总结 排版格式修复
jinbudaily Jul 19, 2023
406cada
Merge pull request #2191 from jinbudaily/master
youngyangyang04 Jul 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
更新 哈希表总结 排版格式修复
  • Loading branch information
jinbudaily committed Jul 19, 2023
commit ddee6adbbba4db9466cf720307b2e44f10e22140
17 changes: 9 additions & 8 deletions problems/哈希表总结.md
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

> 哈希表总结篇如约而至

# 哈希表总结篇

# 哈希表理论基础

## 哈希表理论基础

在[关于哈希表,你该了解这些!](https://programmercarl.com/哈希表理论基础.html)中,我们介绍了哈希表的基础理论知识,不同于枯燥的讲解,这里介绍了都是对刷题有帮助的理论知识点。

Expand All @@ -32,9 +34,9 @@

**只有对这些数据结构的底层实现很熟悉,才能灵活使用,否则很容易写出效率低下的程序**。

# 哈希表经典题目
## 哈希表经典题目

## 数组作为哈希表
### 数组作为哈希表

一些应用场景就是为数组量身定做的。

Expand All @@ -51,7 +53,7 @@
**上面两道题目用map确实可以,但使用map的空间消耗要比数组大一些,因为map要维护红黑树或者符号表,而且还要做哈希函数的运算。所以数组更加简单直接有效!**


## set作为哈希表
### set作为哈希表

在[349. 两个数组的交集](https://programmercarl.com/0349.两个数组的交集.html)中我们给出了什么时候用数组就不行了,需要用set。

Expand All @@ -75,7 +77,7 @@ std::set和std::multiset底层实现都是红黑树,std::unordered_set的底
在[202.快乐数](https://programmercarl.com/0202.快乐数.html)中,我们再次使用了unordered_set来判断一个数是否重复出现过。


## map作为哈希表
### map作为哈希表

在[1.两数之和](https://programmercarl.com/0001.两数之和.html)中map正式登场。

Expand Down Expand Up @@ -110,7 +112,7 @@ std::unordered_map 底层实现为哈希,std::map 和std::multimap 的底层

所以18. 四数之和,15.三数之和都推荐使用双指针法!

# 总结
## 总结

对于哈希表的知识相信很多同学都知道,但是没有成体系。

Expand All @@ -123,9 +125,8 @@ std::unordered_map 底层实现为哈希,std::map 和std::multimap 的底层





<p align="center">
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
</a>

AltStyle によって変換されたページ (->オリジナル) /