Merge branch 'master' of https://github.com/CyC2018/CS-Notes
This commit is contained in:
commit
eeb8e2a2c5
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1 +1 @@
|
||||
*.md linguist-language=java
|
||||
*.md linguist-language=java
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
.DS_Store
|
||||
*.txt
|
||||
!tencent13147342467085209222.txt
|
||||
.DS_Store
|
||||
*.txt
|
||||
!tencent13147342467085209222.txt
|
||||
desktop.ini
|
300
README.md
300
README.md
@ -1,150 +1,150 @@
|
||||
<div align="center">
|
||||
<a href="https://gitstar-ranking.com/repositories"> <img src="https://badgen.net/badge/Rank/20?icon=github&color=4ab8a1"></a>
|
||||
<a href="assets/download.md"> <img src="https://badgen.net/badge/OvO/%E7%A6%BB%E7%BA%BF%E4%B8%8B%E8%BD%BD?icon=telegram&color=4ab8a1"></a>
|
||||
<a href="https://cyc2018.github.io/CS-Notes"> <img src="https://badgen.net/badge/CyC/%E5%9C%A8%E7%BA%BF%E9%98%85%E8%AF%BB?icon=sourcegraph&color=4ab8a1"></a>
|
||||
<a href="#微信公众号"> <img src="https://badgen.net/badge/%e5%85%ac%e4%bc%97%e5%8f%b7/CyC2018?icon=rss&color=4ab8a1"></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
| 算法 | 操作系统 | 网络 |面向对象| 数据库 | Java | 系统设计| 工具 |编码实践| 后记 |
|
||||
| :---: | :----: | :---: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
|
||||
| [:pencil2:](#pencil2-算法) | [:computer:](#computer-操作系统) | [:cloud:](#cloud-网络) | [:art:](#art-面向对象) | [:floppy_disk:](#floppy_disk-数据库) |[:coffee:](#coffee-java)| [:bulb:](#bulb-系统设计) |[:wrench:](#wrench-工具)| [:watermelon:](#watermelon-编码实践) |[:memo:](#memo-后记)|
|
||||
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
<img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/githubio/LogoMakr_0zpEzN.png" width="200px">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
## :pencil2: 算法
|
||||
|
||||
- [剑指 Offer 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/剑指%20Offer%20题解%20-%20目录.md)
|
||||
- [Leetcode 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/Leetcode%20题解%20-%20目录.md)
|
||||
- [算法](https://github.com/CyC2018/CS-Notes/blob/master/notes/算法%20-%20目录.md)
|
||||
- [笔试面试题库](https://www.nowcoder.com/contestRoom?from=cyc_github)
|
||||
|
||||
## :computer: 操作系统
|
||||
|
||||
- [计算机操作系统](https://github.com/CyC2018/CS-Notes/blob/master/notes/计算机操作系统%20-%20目录.md)
|
||||
- [Linux](https://github.com/CyC2018/CS-Notes/blob/master/notes/Linux.md)
|
||||
|
||||
## :cloud: 网络
|
||||
|
||||
- [计算机网络](https://github.com/CyC2018/CS-Notes/blob/master/notes/计算机网络%20-%20目录.md)
|
||||
- [HTTP](https://github.com/CyC2018/CS-Notes/blob/master/notes/HTTP.md)
|
||||
- [Socket](https://github.com/CyC2018/CS-Notes/blob/master/notes/Socket.md)
|
||||
|
||||
## :art: 面向对象
|
||||
|
||||
- [面向对象思想](https://github.com/CyC2018/CS-Notes/blob/master/notes/面向对象思想.md)
|
||||
- [设计模式](https://github.com/CyC2018/CS-Notes/blob/master/notes/设计模式%20-%20目录.md)
|
||||
|
||||
## :floppy_disk: 数据库
|
||||
|
||||
- [数据库系统原理](https://github.com/CyC2018/CS-Notes/blob/master/notes/数据库系统原理.md)
|
||||
- [SQL](https://github.com/CyC2018/CS-Notes/blob/master/notes/SQL.md)
|
||||
- [Leetcode-Database 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/Leetcode-Database%20题解.md)
|
||||
- [MySQL](https://github.com/CyC2018/CS-Notes/blob/master/notes/MySQL.md)
|
||||
- [Redis](https://github.com/CyC2018/CS-Notes/blob/master/notes/Redis.md)
|
||||
|
||||
## :coffee: Java
|
||||
|
||||
- [Java 基础](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20基础.md)
|
||||
- [Java 容器](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20容器.md)
|
||||
- [Java 并发](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20并发.md)
|
||||
- [Java 虚拟机](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20虚拟机.md)
|
||||
- [Java I/O](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20IO.md)
|
||||
|
||||
## :bulb: 系统设计
|
||||
|
||||
- [系统设计基础](https://github.com/CyC2018/CS-Notes/blob/master/notes/系统设计基础.md)
|
||||
- [分布式](https://github.com/CyC2018/CS-Notes/blob/master/notes/分布式.md)
|
||||
- [集群](https://github.com/CyC2018/CS-Notes/blob/master/notes/集群.md)
|
||||
- [攻击技术](https://github.com/CyC2018/CS-Notes/blob/master/notes/攻击技术.md)
|
||||
- [缓存](https://github.com/CyC2018/CS-Notes/blob/master/notes/缓存.md)
|
||||
- [消息队列](https://github.com/CyC2018/CS-Notes/blob/master/notes/消息队列.md)
|
||||
|
||||
## :wrench: 工具
|
||||
|
||||
- [Git](https://github.com/CyC2018/CS-Notes/blob/master/notes/Git.md)
|
||||
- [Docker](https://github.com/CyC2018/CS-Notes/blob/master/notes/Docker.md)
|
||||
- [构建工具](https://github.com/CyC2018/CS-Notes/blob/master/notes/构建工具.md)
|
||||
- [正则表达式](https://github.com/CyC2018/CS-Notes/blob/master/notes/正则表达式.md)
|
||||
|
||||
## :watermelon: 编码实践
|
||||
|
||||
- [代码可读性](https://github.com/CyC2018/CS-Notes/blob/master/notes/代码可读性.md)
|
||||
- [代码风格规范](https://github.com/CyC2018/CS-Notes/blob/master/notes/代码风格规范.md)
|
||||
|
||||
## :memo: 后记
|
||||
|
||||
<div align="center">
|
||||
<a href="https://www.nowcoder.com/discuss/137593?from=cyc_github"> 我的面经 </a> / <a href="https://cyc2018.github.io"> 我的简历 </a> / <a href="https://github.com/CyC2018/Markdown-Resume"> 简历模版 </a> / <a href="https://github.com/CyC2018/Job-Recommend"> 内推 </a> / <a href="https://xiaozhuanlan.com/CyC2018"> 专栏 </a> / <a href="assets/QQ2群.png"> QQ 群</a>
|
||||
<br><br>
|
||||
<img width="320px" src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/githubio/公众号二维码-2.png"></img>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
### 排版
|
||||
|
||||
笔记内容按照 [中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) 进行排版,以保证内容的可读性。
|
||||
|
||||
不使用 `![]()` 这种方式来引用图片,而是用 `<img>` 标签。一方面是为了能够控制图片以合适的大小显示,另一方面是因为 [GFM](https://github.github.com/gfm/) 不支持 `<center> ![]() </center>` 这种方法让图片居中显示,只能使用 `<div align="center"> <img src=""/> </div>` 达到居中的效果。
|
||||
|
||||
在线排版工具:[Text-Typesetting](https://github.com/CyC2018/Text-Typesetting)。
|
||||
|
||||
### License
|
||||
|
||||
本仓库的内容不是将网上的资料随意拼凑而来,除了少部分引用书上和技术文档的原文(这部分内容都在末尾的参考链接中加了出处),其余都是我的原创。在您引用本仓库内容或者对内容进行修改演绎时,请署名并以相同方式共享,谢谢。
|
||||
|
||||
转载文章请在开头明显处标明该页面地址,公众号等其它转载请联系 zhengyc101@163.com。
|
||||
|
||||
Logo:[logomakr](https://logomakr.com/)
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a>
|
||||
|
||||
### 致谢
|
||||
|
||||
感谢以下人员对本仓库做出的贡献,当然不仅仅只有这些贡献者,这里就不一一列举了。如果你希望被添加到这个名单中,并且提交过 Issue 或者 PR,请与我联系。
|
||||
|
||||
<a href="https://github.com/linw7">
|
||||
<img src="https://avatars3.githubusercontent.com/u/21679154?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/g10guang">
|
||||
<img src="https://avatars1.githubusercontent.com/u/18458140?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/Sctwang">
|
||||
<img src="https://avatars3.githubusercontent.com/u/33345444?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/ResolveWang">
|
||||
<img src="https://avatars1.githubusercontent.com/u/8018776?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/crossoverJie">
|
||||
<img src="https://avatars1.githubusercontent.com/u/15684156?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/jy03078584">
|
||||
<img src="https://avatars2.githubusercontent.com/u/7719370?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/kwongtailau">
|
||||
<img src="https://avatars0.githubusercontent.com/u/22954582?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/xiangflight">
|
||||
<img src="https://avatars2.githubusercontent.com/u/10072416?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/mafulong">
|
||||
<img src="https://avatars1.githubusercontent.com/u/24795000?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/yanglbme">
|
||||
<img src="https://avatars1.githubusercontent.com/u/21008209?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/OOCZC">
|
||||
<img src="https://avatars1.githubusercontent.com/u/11623828?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/5renyuebing">
|
||||
<img src="https://avatars1.githubusercontent.com/u/32872430?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<div align="center">
|
||||
<a href="https://gitstar-ranking.com/repositories"> <img src="https://badgen.net/badge/Rank/20?icon=github&color=4ab8a1"></a>
|
||||
<a href="assets/download.md"> <img src="https://badgen.net/badge/OvO/%E7%A6%BB%E7%BA%BF%E4%B8%8B%E8%BD%BD?icon=telegram&color=4ab8a1"></a>
|
||||
<a href="https://cyc2018.github.io/CS-Notes"> <img src="https://badgen.net/badge/CyC/%E5%9C%A8%E7%BA%BF%E9%98%85%E8%AF%BB?icon=sourcegraph&color=4ab8a1"></a>
|
||||
<a href="#微信公众号"> <img src="https://badgen.net/badge/%e5%85%ac%e4%bc%97%e5%8f%b7/CyC2018?icon=rss&color=4ab8a1"></a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
| 算法 | 操作系统 | 网络 |面向对象| 数据库 | Java | 系统设计| 工具 |编码实践| 后记 |
|
||||
| :---: | :----: | :---: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
|
||||
| [:pencil2:](#pencil2-算法) | [:computer:](#computer-操作系统) | [:cloud:](#cloud-网络) | [:art:](#art-面向对象) | [:floppy_disk:](#floppy_disk-数据库) |[:coffee:](#coffee-java)| [:bulb:](#bulb-系统设计) |[:wrench:](#wrench-工具)| [:watermelon:](#watermelon-编码实践) |[:memo:](#memo-后记)|
|
||||
|
||||
<br>
|
||||
|
||||
<div align="center">
|
||||
<img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/githubio/LogoMakr_0zpEzN.png" width="200px">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
## :pencil2: 算法
|
||||
|
||||
- [剑指 Offer 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/剑指%20Offer%20题解%20-%20目录.md)
|
||||
- [Leetcode 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/Leetcode%20题解%20-%20目录.md)
|
||||
- [算法](https://github.com/CyC2018/CS-Notes/blob/master/notes/算法%20-%20目录.md)
|
||||
- [笔试面试题库](https://www.nowcoder.com/contestRoom?from=cyc_github)
|
||||
|
||||
## :computer: 操作系统
|
||||
|
||||
- [计算机操作系统](https://github.com/CyC2018/CS-Notes/blob/master/notes/计算机操作系统%20-%20目录.md)
|
||||
- [Linux](https://github.com/CyC2018/CS-Notes/blob/master/notes/Linux.md)
|
||||
|
||||
## :cloud: 网络
|
||||
|
||||
- [计算机网络](https://github.com/CyC2018/CS-Notes/blob/master/notes/计算机网络%20-%20目录.md)
|
||||
- [HTTP](https://github.com/CyC2018/CS-Notes/blob/master/notes/HTTP.md)
|
||||
- [Socket](https://github.com/CyC2018/CS-Notes/blob/master/notes/Socket.md)
|
||||
|
||||
## :art: 面向对象
|
||||
|
||||
- [面向对象思想](https://github.com/CyC2018/CS-Notes/blob/master/notes/面向对象思想.md)
|
||||
- [设计模式](https://github.com/CyC2018/CS-Notes/blob/master/notes/设计模式%20-%20目录.md)
|
||||
|
||||
## :floppy_disk: 数据库
|
||||
|
||||
- [数据库系统原理](https://github.com/CyC2018/CS-Notes/blob/master/notes/数据库系统原理.md)
|
||||
- [SQL](https://github.com/CyC2018/CS-Notes/blob/master/notes/SQL.md)
|
||||
- [Leetcode-Database 题解](https://github.com/CyC2018/CS-Notes/blob/master/notes/Leetcode-Database%20题解.md)
|
||||
- [MySQL](https://github.com/CyC2018/CS-Notes/blob/master/notes/MySQL.md)
|
||||
- [Redis](https://github.com/CyC2018/CS-Notes/blob/master/notes/Redis.md)
|
||||
|
||||
## :coffee: Java
|
||||
|
||||
- [Java 基础](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20基础.md)
|
||||
- [Java 容器](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20容器.md)
|
||||
- [Java 并发](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20并发.md)
|
||||
- [Java 虚拟机](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20虚拟机.md)
|
||||
- [Java I/O](https://github.com/CyC2018/CS-Notes/blob/master/notes/Java%20IO.md)
|
||||
|
||||
## :bulb: 系统设计
|
||||
|
||||
- [系统设计基础](https://github.com/CyC2018/CS-Notes/blob/master/notes/系统设计基础.md)
|
||||
- [分布式](https://github.com/CyC2018/CS-Notes/blob/master/notes/分布式.md)
|
||||
- [集群](https://github.com/CyC2018/CS-Notes/blob/master/notes/集群.md)
|
||||
- [攻击技术](https://github.com/CyC2018/CS-Notes/blob/master/notes/攻击技术.md)
|
||||
- [缓存](https://github.com/CyC2018/CS-Notes/blob/master/notes/缓存.md)
|
||||
- [消息队列](https://github.com/CyC2018/CS-Notes/blob/master/notes/消息队列.md)
|
||||
|
||||
## :wrench: 工具
|
||||
|
||||
- [Git](https://github.com/CyC2018/CS-Notes/blob/master/notes/Git.md)
|
||||
- [Docker](https://github.com/CyC2018/CS-Notes/blob/master/notes/Docker.md)
|
||||
- [构建工具](https://github.com/CyC2018/CS-Notes/blob/master/notes/构建工具.md)
|
||||
- [正则表达式](https://github.com/CyC2018/CS-Notes/blob/master/notes/正则表达式.md)
|
||||
|
||||
## :watermelon: 编码实践
|
||||
|
||||
- [代码可读性](https://github.com/CyC2018/CS-Notes/blob/master/notes/代码可读性.md)
|
||||
- [代码风格规范](https://github.com/CyC2018/CS-Notes/blob/master/notes/代码风格规范.md)
|
||||
|
||||
## :memo: 后记
|
||||
|
||||
<div align="center">
|
||||
<a href="https://www.nowcoder.com/discuss/137593?from=cyc_github"> 我的面经 </a> / <a href="https://cyc2018.github.io"> 我的简历 </a> / <a href="https://github.com/CyC2018/Markdown-Resume"> 简历模版 </a> / <a href="https://github.com/CyC2018/Job-Recommend"> 内推 </a> / <a href="https://xiaozhuanlan.com/CyC2018"> 专栏 </a> / <a href="assets/QQ2群.png"> QQ 群</a>
|
||||
<br><br>
|
||||
<img width="320px" src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/githubio/公众号二维码-2.png"></img>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
### 排版
|
||||
|
||||
笔记内容按照 [中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines) 进行排版,以保证内容的可读性。
|
||||
|
||||
不使用 `![]()` 这种方式来引用图片,而是用 `<img>` 标签。一方面是为了能够控制图片以合适的大小显示,另一方面是因为 [GFM](https://github.github.com/gfm/) 不支持 `<center> ![]() </center>` 这种方法让图片居中显示,只能使用 `<div align="center"> <img src=""/> </div>` 达到居中的效果。
|
||||
|
||||
在线排版工具:[Text-Typesetting](https://github.com/CyC2018/Text-Typesetting)。
|
||||
|
||||
### License
|
||||
|
||||
本仓库的内容不是将网上的资料随意拼凑而来,除了少部分引用书上和技术文档的原文(这部分内容都在末尾的参考链接中加了出处),其余都是我的原创。在您引用本仓库内容或者对内容进行修改演绎时,请署名并以相同方式共享,谢谢。
|
||||
|
||||
转载文章请在开头明显处标明该页面地址,公众号等其它转载请联系 zhengyc101@163.com。
|
||||
|
||||
Logo:[logomakr](https://logomakr.com/)
|
||||
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="知识共享许可协议" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a>
|
||||
|
||||
### 致谢
|
||||
|
||||
感谢以下人员对本仓库做出的贡献,当然不仅仅只有这些贡献者,这里就不一一列举了。如果你希望被添加到这个名单中,并且提交过 Issue 或者 PR,请与我联系。
|
||||
|
||||
<a href="https://github.com/linw7">
|
||||
<img src="https://avatars3.githubusercontent.com/u/21679154?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/g10guang">
|
||||
<img src="https://avatars1.githubusercontent.com/u/18458140?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/Sctwang">
|
||||
<img src="https://avatars3.githubusercontent.com/u/33345444?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/ResolveWang">
|
||||
<img src="https://avatars1.githubusercontent.com/u/8018776?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/crossoverJie">
|
||||
<img src="https://avatars1.githubusercontent.com/u/15684156?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/jy03078584">
|
||||
<img src="https://avatars2.githubusercontent.com/u/7719370?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/kwongtailau">
|
||||
<img src="https://avatars0.githubusercontent.com/u/22954582?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/xiangflight">
|
||||
<img src="https://avatars2.githubusercontent.com/u/10072416?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/mafulong">
|
||||
<img src="https://avatars1.githubusercontent.com/u/24795000?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/yanglbme">
|
||||
<img src="https://avatars1.githubusercontent.com/u/21008209?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/OOCZC">
|
||||
<img src="https://avatars1.githubusercontent.com/u/11623828?s=400&v=4" width="50px">
|
||||
</a>
|
||||
<a href="https://github.com/5renyuebing">
|
||||
<img src="https://avatars1.githubusercontent.com/u/32872430?s=400&v=4" width="50px">
|
||||
</a>
|
||||
|
@ -1,34 +1,34 @@
|
||||
# 目的
|
||||
|
||||
考虑到有部分读者的网络环境较差,有时候在线访问速度很慢,导致阅读体验不佳。另外,PDF 等格式的离线版本相比于网页在线版本更方便做笔记。因此提供离线阅读版本给大家下载。
|
||||
|
||||
# 内容
|
||||
|
||||
有三种格式的离线版本:PDF、Markdown 和 HTML 。
|
||||
|
||||
## PDF
|
||||
|
||||
优点是方便做笔记;缺点是不能显示 GIF 图片(所以“剑指 Offer 题解”不建议使用 PDF 进行阅读),以及显示效果不佳。
|
||||
|
||||

|
||||
|
||||
## Markdown
|
||||
|
||||
优点是能很好地显示 GIF 图片,显示效果也很好;缺点是由于将所有内容整合在同一个文件中,导致实时渲染有点卡顿。
|
||||
|
||||

|
||||
|
||||
## HTML
|
||||
|
||||
优点是和 Markdown 的显示效果几乎一致,同时不需要 Markdown 的实时渲染,因此浏览速度更快;缺点是目录功能还不是很完善。
|
||||
|
||||
如果想在安卓手机端阅读,推荐使用这种格式,将 html 文件和图片文件都复制到手机上,用浏览器打开 html 文件并存成书签,以后就可以快速地离线阅读。
|
||||
|
||||

|
||||
|
||||
# 如何下载
|
||||
|
||||
离线版本由公众号 **CyC2018** 发布,最新版本也会在上面及时发布,在后台回复 **CyC** 即可获取下载链接。
|
||||
|
||||
<div align="center"><img width="350px" src="公众号二维码-1.png"></img></div>
|
||||
|
||||
# 目的
|
||||
|
||||
考虑到有部分读者的网络环境较差,有时候在线访问速度很慢,导致阅读体验不佳。另外,PDF 等格式的离线版本相比于网页在线版本更方便做笔记。因此提供离线阅读版本给大家下载。
|
||||
|
||||
# 内容
|
||||
|
||||
有三种格式的离线版本:PDF、Markdown 和 HTML 。
|
||||
|
||||
## PDF
|
||||
|
||||
优点是方便做笔记;缺点是不能显示 GIF 图片(所以“剑指 Offer 题解”不建议使用 PDF 进行阅读),以及显示效果不佳。
|
||||
|
||||

|
||||
|
||||
## Markdown
|
||||
|
||||
优点是能很好地显示 GIF 图片,显示效果也很好;缺点是由于将所有内容整合在同一个文件中,导致实时渲染有点卡顿。
|
||||
|
||||

|
||||
|
||||
## HTML
|
||||
|
||||
优点是和 Markdown 的显示效果几乎一致,同时不需要 Markdown 的实时渲染,因此浏览速度更快;缺点是目录功能还不是很完善。
|
||||
|
||||
如果想在安卓手机端阅读,推荐使用这种格式,将 html 文件和图片文件都复制到手机上,用浏览器打开 html 文件并存成书签,以后就可以快速地离线阅读。
|
||||
|
||||

|
||||
|
||||
# 如何下载
|
||||
|
||||
离线版本由公众号 **CyC2018** 发布,最新版本也会在上面及时发布,在后台回复 **CyC** 即可获取下载链接。
|
||||
|
||||
<div align="center"><img width="350px" src="公众号二维码-1.png"></img></div>
|
||||
|
||||
|
128
docs/README.md
128
docs/README.md
@ -1,64 +1,64 @@
|
||||
- [点击订阅面试进阶指南](https://xiaozhuanlan.com/CyC2018)
|
||||
|
||||
## ✏️ 算法
|
||||
|
||||
- [剑指 Offer 题解](notes/剑指%20Offer%20题解%20-%20目录1.md) </br>
|
||||
- [Leetcode 题解](notes/Leetcode%20题解%20-%20目录1.md) </br>
|
||||
- [算法](notes/算法%20-%20目录1.md) </br>
|
||||
- [后端面试进阶指南](https://xiaozhuanlan.com/CyC2018)
|
||||
|
||||
## 💻 操作系统
|
||||
|
||||
- [计算机操作系统](notes/计算机操作系统%20-%20目录1.md) </br>
|
||||
- [Linux](notes/Linux.md)
|
||||
|
||||
## ☁️ 网络
|
||||
|
||||
- [计算机网络](notes/计算机网络%20-%20目录1.md) </br>
|
||||
- [HTTP](notes/HTTP.md) </br>
|
||||
- [Socket](notes/Socket.md)
|
||||
|
||||
## 🎨 面向对象
|
||||
|
||||
- [设计模式](notes/设计模式%20-%20目录1.md) </br>
|
||||
- [面向对象思想](notes/面向对象思想.md)
|
||||
|
||||
## 💾 数据库
|
||||
|
||||
- [数据库系统原理](notes/数据库系统原理.md) </br>
|
||||
- [SQL](notes/SQL.md) </br>
|
||||
- [Leetcode-Database 题解](notes/Leetcode-Database%20题解.md) </br>
|
||||
- [MySQL](notes/MySQL.md) </br>
|
||||
- [Redis](notes/Redis.md)
|
||||
|
||||
## ☕️ Java
|
||||
|
||||
- [Java 基础](notes/Java%20基础.md) </br>
|
||||
- [Java 容器](notes/Java%20容器.md) </br>
|
||||
- [Java 并发](notes/Java%20并发.md) </br>
|
||||
- [Java 虚拟机](notes/Java%20虚拟机.md) </br>
|
||||
- [Java I/O](notes/Java%20IO.md)
|
||||
|
||||
## 💡 系统设计
|
||||
|
||||
- [系统设计基础](notes/系统设计基础.md) </br>
|
||||
- [分布式](notes/分布式.md) </br>
|
||||
- [集群](notes/集群.md) </br>
|
||||
- [攻击技术](notes/攻击技术.md) </br>
|
||||
- [缓存](notes/缓存.md) </br>
|
||||
- [消息队列](notes/消息队列.md)
|
||||
|
||||
## 🔧 工具
|
||||
|
||||
- [Git](notes/Git.md) </br>
|
||||
- [Docker](notes/Docker.md) </br>
|
||||
- [正则表达式](notes/正则表达式.md) </br>
|
||||
- [构建工具](notes/构建工具.md)
|
||||
|
||||
<!--⭐️欢迎关注我的公众号 CyC2018,在公众号后台回复关键字 📚 **资料** 可领取复习大纲,这份大纲是我花了一整年时间整理的面试知识点列表,不仅系统整理了面试知识点,而且标注了各个知识点的重要程度,从而帮你理清多而杂的面试知识点。可以说我基本是按照这份大纲来进行复习的,这份大纲对我拿到了 BAT 头条等 Offer 起到很大的帮助。你们完全可以和我一样根据大纲上列的知识点来进行复习,就不用看很多不重要的内容,也可以知道哪些内容很重要从而多安排一些复习时间。
|
||||
<br/><br/>
|
||||
<div align="center">
|
||||
<img src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/%E5%85%AC%E4%BC%97%E5%8F%B7.jpg" width="200px">
|
||||
</div> -->
|
||||
|
||||
|
||||
- [点击订阅面试进阶指南](https://xiaozhuanlan.com/CyC2018)
|
||||
|
||||
## ✏️ 算法
|
||||
|
||||
- [剑指 Offer 题解](notes/剑指%20Offer%20题解%20-%20目录1.md) </br>
|
||||
- [Leetcode 题解](notes/Leetcode%20题解%20-%20目录1.md) </br>
|
||||
- [算法](notes/算法%20-%20目录1.md) </br>
|
||||
- [后端面试进阶指南](https://xiaozhuanlan.com/CyC2018)
|
||||
|
||||
## 💻 操作系统
|
||||
|
||||
- [计算机操作系统](notes/计算机操作系统%20-%20目录1.md) </br>
|
||||
- [Linux](notes/Linux.md)
|
||||
|
||||
## ☁️ 网络
|
||||
|
||||
- [计算机网络](notes/计算机网络%20-%20目录1.md) </br>
|
||||
- [HTTP](notes/HTTP.md) </br>
|
||||
- [Socket](notes/Socket.md)
|
||||
|
||||
## 🎨 面向对象
|
||||
|
||||
- [设计模式](notes/设计模式%20-%20目录1.md) </br>
|
||||
- [面向对象思想](notes/面向对象思想.md)
|
||||
|
||||
## 💾 数据库
|
||||
|
||||
- [数据库系统原理](notes/数据库系统原理.md) </br>
|
||||
- [SQL](notes/SQL.md) </br>
|
||||
- [Leetcode-Database 题解](notes/Leetcode-Database%20题解.md) </br>
|
||||
- [MySQL](notes/MySQL.md) </br>
|
||||
- [Redis](notes/Redis.md)
|
||||
|
||||
## ☕️ Java
|
||||
|
||||
- [Java 基础](notes/Java%20基础.md) </br>
|
||||
- [Java 容器](notes/Java%20容器.md) </br>
|
||||
- [Java 并发](notes/Java%20并发.md) </br>
|
||||
- [Java 虚拟机](notes/Java%20虚拟机.md) </br>
|
||||
- [Java I/O](notes/Java%20IO.md)
|
||||
|
||||
## 💡 系统设计
|
||||
|
||||
- [系统设计基础](notes/系统设计基础.md) </br>
|
||||
- [分布式](notes/分布式.md) </br>
|
||||
- [集群](notes/集群.md) </br>
|
||||
- [攻击技术](notes/攻击技术.md) </br>
|
||||
- [缓存](notes/缓存.md) </br>
|
||||
- [消息队列](notes/消息队列.md)
|
||||
|
||||
## 🔧 工具
|
||||
|
||||
- [Git](notes/Git.md) </br>
|
||||
- [Docker](notes/Docker.md) </br>
|
||||
- [正则表达式](notes/正则表达式.md) </br>
|
||||
- [构建工具](notes/构建工具.md)
|
||||
|
||||
<!--⭐️欢迎关注我的公众号 CyC2018,在公众号后台回复关键字 📚 **资料** 可领取复习大纲,这份大纲是我花了一整年时间整理的面试知识点列表,不仅系统整理了面试知识点,而且标注了各个知识点的重要程度,从而帮你理清多而杂的面试知识点。可以说我基本是按照这份大纲来进行复习的,这份大纲对我拿到了 BAT 头条等 Offer 起到很大的帮助。你们完全可以和我一样根据大纲上列的知识点来进行复习,就不用看很多不重要的内容,也可以知道哪些内容很重要从而多安排一些复习时间。
|
||||
<br/><br/>
|
||||
<div align="center">
|
||||
<img src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/%E5%85%AC%E4%BC%97%E5%8F%B7.jpg" width="200px">
|
||||
</div> -->
|
||||
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<img width="220px" src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/other/LogoMakr_0zpEzN.png">
|
||||
|
||||
|
||||
- 本项目包含了技术面试必备的基础知识,内容浅显易懂,你不需要花很长的时间去阅读和理解成堆的技术书籍就可以快速掌握这些知识,从而节省宝贵的面试复习时间。
|
||||
|
||||
<!--<span id="busuanzi_container_site_pv">Site View : <span id="busuanzi_value_site_pv">-->
|
||||
|
||||
[](https://github.com/CyC2018/CS-Notes) [](https://github.com/CyC2018/CS-Notes)
|
||||
|
||||
[开始阅读](README.md)
|
||||
|
||||
<img width="220px" src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/other/LogoMakr_0zpEzN.png">
|
||||
|
||||
|
||||
- 本项目包含了技术面试必备的基础知识,内容浅显易懂,你不需要花很长的时间去阅读和理解成堆的技术书籍就可以快速掌握这些知识,从而节省宝贵的面试复习时间。
|
||||
|
||||
<!--<span id="busuanzi_container_site_pv">Site View : <span id="busuanzi_value_site_pv">-->
|
||||
|
||||
[](https://github.com/CyC2018/CS-Notes) [](https://github.com/CyC2018/CS-Notes)
|
||||
|
||||
[开始阅读](README.md)
|
||||
|
||||
|
876
docs/index.html
876
docs/index.html
@ -1,439 +1,439 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CS-Notes</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="Description">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0">
|
||||
<link rel="icon" href=" https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/LogoMakr_1J56bI.png">
|
||||
<link rel="stylesheet" href="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/vue.css">
|
||||
|
||||
<!-- 将自定义样式放在 Github 上会导致加载速度变得非常慢,所以采取直接内嵌的方式 -->
|
||||
<style type="text/css">
|
||||
|
||||
/* 隐藏头部的目录 */
|
||||
#main>ul:nth-child(1) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#main>ul:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1+ul {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.markdown-section h1 {
|
||||
margin: 3rem 0 2rem 0;
|
||||
}
|
||||
|
||||
.markdown-section h2 {
|
||||
margin: 2rem 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
pre {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.markdown-section p.tip,
|
||||
.markdown-section tr:nth-child(1n) {
|
||||
background-color: #f8f8f8 !important;
|
||||
}
|
||||
|
||||
.content,
|
||||
.sidebar,
|
||||
.markdown-section,
|
||||
body,
|
||||
.search input {
|
||||
background-color: rgba(243, 242, 238, 1) !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
.sidebar-toggle {
|
||||
background-color: #f3f2ee;
|
||||
}
|
||||
}
|
||||
|
||||
.docsify-copy-code-button {
|
||||
background: #f8f8f8 !important;
|
||||
color: #7a7a7a !important;
|
||||
}
|
||||
|
||||
body {
|
||||
/*font-family: Microsoft YaHei, Source Sans Pro, Helvetica Neue, Arial, sans-serif !important;*/
|
||||
}
|
||||
|
||||
.markdown-section pre>code {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
code,
|
||||
pre {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.markdown-section>p {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.markdown-section pre>code {
|
||||
font-family: Consolas, Roboto Mono, Monaco, courier, monospace !important;
|
||||
}
|
||||
|
||||
p, h1, h2, h3, h4, ol, ul {
|
||||
letter-spacing: 2px !important;
|
||||
}
|
||||
|
||||
p, ol, ul {
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
.markdown-section pre>code {
|
||||
font-size: .9rem !important;
|
||||
letter-spacing: 1.1px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:600px) {
|
||||
.markdown-section pre>code {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
|
||||
pre:after {
|
||||
content: "" !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*.anchor span {
|
||||
color: rgb(66, 185, 131);
|
||||
}*/
|
||||
|
||||
section.cover h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body>section>div.cover-main>ul>li>a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
.markdown-section > div > img,
|
||||
.markdown-section pre {
|
||||
box-shadow: 0px 0px 20px 11px #eaeaea;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f3f2ee !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
pre code {
|
||||
/*box-shadow: 2px 1px 20px 2px #aaa;*/
|
||||
/*border-radius: 10px !important;*/
|
||||
padding-left: 20px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:600px) {
|
||||
pre {
|
||||
padding-left: 3px !important;
|
||||
padding-right: 3px !important;
|
||||
margin-left: -20px !important;
|
||||
margin-right: -20px !important;
|
||||
box-shadow: 0px 0px 20px 0px #eee !important;
|
||||
}
|
||||
|
||||
|
||||
.docsify-copy-code-button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-section pre {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
/**
|
||||
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
|
||||
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
|
||||
* @author Tim Shedor
|
||||
*/
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
position: relative;
|
||||
margin: .5em 0;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
pre[class*="language-"]>code {
|
||||
position: relative;
|
||||
border-left: 10px solid #358ccb;
|
||||
box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
|
||||
background-color: #fdfdfd;
|
||||
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
|
||||
background-size: 3em 3em;
|
||||
background-origin: content-box;
|
||||
background-attachment: local;
|
||||
}
|
||||
|
||||
code[class*="language"] {
|
||||
max-height: inherit;
|
||||
height: inherit;
|
||||
padding: 0 1em;
|
||||
display: block;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Margin bottom to accommodate shadow */
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background-color: #fdfdfd;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
position: relative;
|
||||
padding: .2em;
|
||||
border-radius: 0.3em;
|
||||
color: #c92c2c;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
display: inline;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
pre[class*="language-"]:before,
|
||||
pre[class*="language-"]:after {
|
||||
content: '';
|
||||
z-index: -2;
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0.75em;
|
||||
left: 0.18em;
|
||||
width: 40%;
|
||||
height: 20%;
|
||||
max-height: 13em;
|
||||
box-shadow: 0px 13px 8px #979797;
|
||||
-webkit-transform: rotate(-2deg);
|
||||
-moz-transform: rotate(-2deg);
|
||||
-ms-transform: rotate(-2deg);
|
||||
-o-transform: rotate(-2deg);
|
||||
transform: rotate(-2deg);
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"]:after,
|
||||
pre[class*="language-"]:after {
|
||||
right: 0.75em;
|
||||
left: auto;
|
||||
-webkit-transform: rotate(2deg);
|
||||
-moz-transform: rotate(2deg);
|
||||
-ms-transform: rotate(2deg);
|
||||
-o-transform: rotate(2deg);
|
||||
transform: rotate(2deg);
|
||||
}
|
||||
|
||||
/*黑色*/
|
||||
.token.function,
|
||||
.token.operator,
|
||||
.token.class-name {
|
||||
color: #2C3E50;
|
||||
}
|
||||
|
||||
/*深蓝加粗*/
|
||||
.token.keyword {
|
||||
color: #333;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
/*浅蓝*/
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.function-name,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #2980B9;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.block-comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #7D8B99;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #5F6364;
|
||||
}
|
||||
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #1ABC9C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.token.variable {
|
||||
color: #a67f59;
|
||||
/*background: rgba(255, 255, 255, 0.5);*/
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value {
|
||||
color: #1990b8;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #a67f59;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.token.important {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
pre[class*="language-"]:before,
|
||||
pre[class*="language-"]:after {
|
||||
bottom: 14px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Plugin styles */
|
||||
.token.tab:not(:empty):before,
|
||||
.token.cr:before,
|
||||
.token.lf:before {
|
||||
color: #e0d7d1;
|
||||
}
|
||||
|
||||
/* Plugin styles: Line Numbers */
|
||||
pre[class*="language-"].line-numbers.line-numbers {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers.line-numbers code {
|
||||
padding-left: 3.8em;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Plugin styles: Line Highlight */
|
||||
pre[class*="language-"][data-line] {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
pre[data-line] code {
|
||||
position: relative;
|
||||
padding-left: 4em;
|
||||
}
|
||||
|
||||
pre .line-highlight {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
maxAge: 100,
|
||||
name: 'CS-Notes',
|
||||
repo: 'https://github.com/CyC2018/CS-Notes',
|
||||
search: {
|
||||
paths: 'auto',
|
||||
placeholder: '🔍 Type to search ',
|
||||
noData: '😞 No Results! ',
|
||||
depth: 6
|
||||
},
|
||||
// subMaxLevel: 2,
|
||||
coverpage: true
|
||||
}
|
||||
</script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/docsify.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/docsify/4.5.9/plugins/search.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/docsify-copy-code.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-java.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-c.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-bash.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-sql.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/zoom-image.min.js"></script>
|
||||
<!-- <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> -->
|
||||
</body>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>CS-Notes</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="description" content="Description">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0">
|
||||
<link rel="icon" href=" https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/LogoMakr_1J56bI.png">
|
||||
<link rel="stylesheet" href="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/vue.css">
|
||||
|
||||
<!-- 将自定义样式放在 Github 上会导致加载速度变得非常慢,所以采取直接内嵌的方式 -->
|
||||
<style type="text/css">
|
||||
|
||||
/* 隐藏头部的目录 */
|
||||
#main>ul:nth-child(1) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#main>ul:nth-child(2) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h1+ul {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.markdown-section h1 {
|
||||
margin: 3rem 0 2rem 0;
|
||||
}
|
||||
|
||||
.markdown-section h2 {
|
||||
margin: 2rem 0 1rem;
|
||||
}
|
||||
|
||||
img,
|
||||
pre {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.markdown-section p.tip,
|
||||
.markdown-section tr:nth-child(1n) {
|
||||
background-color: #f8f8f8 !important;
|
||||
}
|
||||
|
||||
.content,
|
||||
.sidebar,
|
||||
.markdown-section,
|
||||
body,
|
||||
.search input {
|
||||
background-color: rgba(243, 242, 238, 1) !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
.sidebar-toggle {
|
||||
background-color: #f3f2ee;
|
||||
}
|
||||
}
|
||||
|
||||
.docsify-copy-code-button {
|
||||
background: #f8f8f8 !important;
|
||||
color: #7a7a7a !important;
|
||||
}
|
||||
|
||||
body {
|
||||
/*font-family: Microsoft YaHei, Source Sans Pro, Helvetica Neue, Arial, sans-serif !important;*/
|
||||
}
|
||||
|
||||
.markdown-section pre>code {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
code,
|
||||
pre {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.markdown-section>p {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.markdown-section pre>code {
|
||||
font-family: Consolas, Roboto Mono, Monaco, courier, monospace !important;
|
||||
}
|
||||
|
||||
p, h1, h2, h3, h4, ol, ul {
|
||||
letter-spacing: 2px !important;
|
||||
}
|
||||
|
||||
p, ol, ul {
|
||||
line-height: 30px !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
.markdown-section pre>code {
|
||||
font-size: .9rem !important;
|
||||
letter-spacing: 1.1px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:600px) {
|
||||
.markdown-section pre>code {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 15px !important;
|
||||
}
|
||||
|
||||
pre:after {
|
||||
content: "" !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*.anchor span {
|
||||
color: rgb(66, 185, 131);
|
||||
}*/
|
||||
|
||||
section.cover h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body>section>div.cover-main>ul>li>a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
.markdown-section > div > img,
|
||||
.markdown-section pre {
|
||||
box-shadow: 0px 0px 20px 11px #eaeaea;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f3f2ee !important;
|
||||
}
|
||||
|
||||
@media (min-width:600px) {
|
||||
pre code {
|
||||
/*box-shadow: 2px 1px 20px 2px #aaa;*/
|
||||
/*border-radius: 10px !important;*/
|
||||
padding-left: 20px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width:600px) {
|
||||
pre {
|
||||
padding-left: 3px !important;
|
||||
padding-right: 3px !important;
|
||||
margin-left: -20px !important;
|
||||
margin-right: -20px !important;
|
||||
box-shadow: 0px 0px 20px 0px #eee !important;
|
||||
}
|
||||
|
||||
|
||||
.docsify-copy-code-button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-section pre {
|
||||
padding-left: 0 !important;
|
||||
padding-right: 0px !important;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
/**
|
||||
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
|
||||
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
|
||||
* @author Tim Shedor
|
||||
*/
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
position: relative;
|
||||
margin: .5em 0;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
pre[class*="language-"]>code {
|
||||
position: relative;
|
||||
border-left: 10px solid #358ccb;
|
||||
box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf;
|
||||
background-color: #fdfdfd;
|
||||
background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%);
|
||||
background-size: 3em 3em;
|
||||
background-origin: content-box;
|
||||
background-attachment: local;
|
||||
}
|
||||
|
||||
code[class*="language"] {
|
||||
max-height: inherit;
|
||||
height: inherit;
|
||||
padding: 0 1em;
|
||||
display: block;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Margin bottom to accommodate shadow */
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background-color: #fdfdfd;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
position: relative;
|
||||
padding: .2em;
|
||||
border-radius: 0.3em;
|
||||
color: #c92c2c;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
display: inline;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
pre[class*="language-"]:before,
|
||||
pre[class*="language-"]:after {
|
||||
content: '';
|
||||
z-index: -2;
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 0.75em;
|
||||
left: 0.18em;
|
||||
width: 40%;
|
||||
height: 20%;
|
||||
max-height: 13em;
|
||||
box-shadow: 0px 13px 8px #979797;
|
||||
-webkit-transform: rotate(-2deg);
|
||||
-moz-transform: rotate(-2deg);
|
||||
-ms-transform: rotate(-2deg);
|
||||
-o-transform: rotate(-2deg);
|
||||
transform: rotate(-2deg);
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"]:after,
|
||||
pre[class*="language-"]:after {
|
||||
right: 0.75em;
|
||||
left: auto;
|
||||
-webkit-transform: rotate(2deg);
|
||||
-moz-transform: rotate(2deg);
|
||||
-ms-transform: rotate(2deg);
|
||||
-o-transform: rotate(2deg);
|
||||
transform: rotate(2deg);
|
||||
}
|
||||
|
||||
/*黑色*/
|
||||
.token.function,
|
||||
.token.operator,
|
||||
.token.class-name {
|
||||
color: #2C3E50;
|
||||
}
|
||||
|
||||
/*深蓝加粗*/
|
||||
.token.keyword {
|
||||
color: #333;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
/*浅蓝*/
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.function-name,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #2980B9;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.block-comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #7D8B99;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #5F6364;
|
||||
}
|
||||
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #1ABC9C;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.token.variable {
|
||||
color: #a67f59;
|
||||
/*background: rgba(255, 255, 255, 0.5);*/
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value {
|
||||
color: #1990b8;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #a67f59;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.token.important {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
pre[class*="language-"]:before,
|
||||
pre[class*="language-"]:after {
|
||||
bottom: 14px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Plugin styles */
|
||||
.token.tab:not(:empty):before,
|
||||
.token.cr:before,
|
||||
.token.lf:before {
|
||||
color: #e0d7d1;
|
||||
}
|
||||
|
||||
/* Plugin styles: Line Numbers */
|
||||
pre[class*="language-"].line-numbers.line-numbers {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers.line-numbers code {
|
||||
padding-left: 3.8em;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers.line-numbers .line-numbers-rows {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Plugin styles: Line Highlight */
|
||||
pre[class*="language-"][data-line] {
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
pre[data-line] code {
|
||||
position: relative;
|
||||
padding-left: 4em;
|
||||
}
|
||||
|
||||
pre .line-highlight {
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
maxAge: 100,
|
||||
name: 'CS-Notes',
|
||||
repo: 'https://github.com/CyC2018/CS-Notes',
|
||||
search: {
|
||||
paths: 'auto',
|
||||
placeholder: '🔍 Type to search ',
|
||||
noData: '😞 No Results! ',
|
||||
depth: 6
|
||||
},
|
||||
// subMaxLevel: 2,
|
||||
coverpage: true
|
||||
}
|
||||
</script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/docsify.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/docsify/4.5.9/plugins/search.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/docsify-copy-code.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-java.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-c.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-bash.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/prism-sql.min.js"></script>
|
||||
<script src="https://cyc-1256109796.cos.ap-guangzhou.myqcloud.com/zoom-image.min.js"></script>
|
||||
<!-- <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script> -->
|
||||
</body>
|
||||
|
||||
</html>
|
@ -521,7 +521,7 @@ public static final int value = 123;
|
||||
其中解析过程在某些情况下可以在初始化阶段之后再开始,这是为了支持 Java 的动态绑定。
|
||||
|
||||
<div data="补充为什么可以支持动态绑定 --> <--"></div>
|
||||
### 5. 初始化
|
||||
### 5. 初始化
|
||||
|
||||
<div data="modify -->"></div>
|
||||
初始化阶段才真正开始执行类中定义的 Java 程序代码。初始化阶段是虚拟机执行类构造器 <clinit>() 方法的过程。在准备阶段,类变量已经赋过一次系统要求的初始值,而在初始化阶段,根据程序员通过程序制定的主观计划去初始化类变量和其它资源。
|
||||
|
@ -1,4 +1,5 @@
|
||||
<!-- GFM-TOC -->
|
||||
* [0. 原理](#0-原理)
|
||||
* [1. 统计两个数的二进制表示有多少位不同](#1-统计两个数的二进制表示有多少位不同)
|
||||
* [2. 数组中唯一一个不重复的元素](#2-数组中唯一一个不重复的元素)
|
||||
* [3. 找出数组中缺失的那个数](#3-找出数组中缺失的那个数)
|
||||
@ -15,7 +16,9 @@
|
||||
<!-- GFM-TOC -->
|
||||
|
||||
|
||||
**基本原理**
|
||||
# 0. 原理
|
||||
|
||||
**基本原理**
|
||||
|
||||
0s 表示一串 0,1s 表示一串 1。
|
||||
|
||||
@ -25,23 +28,79 @@ x ^ 1s = ~x x & 1s = x x | 1s = 1s
|
||||
x ^ x = 0 x & x = x x | x = x
|
||||
```
|
||||
|
||||
- 利用 x ^ 1s = \~x 的特点,可以将位级表示翻转;利用 x ^ x = 0 的特点,可以将三个数中重复的两个数去除,只留下另一个数。
|
||||
- 利用 x & 0s = 0 和 x & 1s = x 的特点,可以实现掩码操作。一个数 num 与 mask:00111100 进行位与操作,只保留 num 中与 mask 的 1 部分相对应的位。
|
||||
- 利用 x | 0s = x 和 x | 1s = 1s 的特点,可以实现设值操作。一个数 num 与 mask:00111100 进行位或操作,将 num 中与 mask 的 1 部分相对应的位都设置为 1。
|
||||
利用 x ^ 1s = \~x 的特点,可以将一个数的位级表示翻转;利用 x ^ x = 0 的特点,可以将三个数中重复的两个数去除,只留下另一个数。
|
||||
|
||||
位与运算技巧:
|
||||
```
|
||||
1^1^2 = 2
|
||||
```
|
||||
|
||||
- n&(n-1) 去除 n 的位级表示中最低的那一位。例如对于二进制表示 10110100,减去 1 得到 10110011,这两个数相与得到 10110000。
|
||||
- n&(-n) 得到 n 的位级表示中最低的那一位。-n 得到 n 的反码加 1,对于二进制表示 10110100,-n 得到 01001100,相与得到 00000100。
|
||||
- n-n&(\~n+1) 去除 n 的位级表示中最高的那一位。
|
||||
利用 x & 0s = 0 和 x & 1s = x 的特点,可以实现掩码操作。一个数 num 与 mask:00111100 进行位与操作,只保留 num 中与 mask 的 1 部分相对应的位。
|
||||
|
||||
移位运算:
|
||||
```
|
||||
01011011 &
|
||||
00111100
|
||||
--------
|
||||
00011000
|
||||
```
|
||||
|
||||
- \>\> n 为算术右移,相当于除以 2<sup>n</sup>;
|
||||
- \>\>\> n 为无符号右移,左边会补上 0。
|
||||
- << n 为算术左移,相当于乘以 2<sup>n</sup>。
|
||||
利用 x | 0s = x 和 x | 1s = 1s 的特点,可以实现设值操作。一个数 num 与 mask:00111100 进行位或操作,将 num 中与 mask 的 1 部分相对应的位都设置为 1。
|
||||
|
||||
** mask 计算**
|
||||
```
|
||||
01011011 |
|
||||
00111100
|
||||
--------
|
||||
01111111
|
||||
```
|
||||
|
||||
**位与运算技巧**
|
||||
|
||||
n&(n-1) 去除 n 的位级表示中最低的那一位 1。例如对于二进制表示 01011011,减去 1 得到 01011010,这两个数相与得到 01011010。
|
||||
|
||||
```
|
||||
01011011 &
|
||||
01011010
|
||||
--------
|
||||
01011010
|
||||
```
|
||||
|
||||
n&(-n) 得到 n 的位级表示中最低的那一位 1。-n 得到 n 的反码加 1,也就是 -n=\~n+1。例如对于二进制表示 10110100,-n 得到 01001100,相与得到 00000100。
|
||||
|
||||
```
|
||||
10110100 &
|
||||
01001100
|
||||
--------
|
||||
00000100
|
||||
```
|
||||
|
||||
n-(n&(-n)) 则可以去除 n 的位级表示中最低的那一位 1,和 n&(n-1) 效果一样。
|
||||
|
||||
**移位运算**
|
||||
|
||||
\>\> n 为算术右移,相当于除以 2<sup>n</sup>,例如 -7 >> 2 = -2。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 >> 2
|
||||
--------
|
||||
11111111111111111111111111111110
|
||||
```
|
||||
|
||||
\>\>\> n 为无符号右移,左边会补上 0。例如 -7 >>> 2 = 1073741822。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 >>> 2
|
||||
--------
|
||||
00111111111111111111111111111111
|
||||
```
|
||||
|
||||
<< n 为算术左移,相当于乘以 2<sup>n</sup>。-7 << 2 = -28。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 << 2
|
||||
--------
|
||||
11111111111111111111111111100100
|
||||
```
|
||||
|
||||
**mask 计算**
|
||||
|
||||
要获取 111111111,将 0 取反即可,\~0。
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/95903878-725b-4ed9-bded-bc4aae0792a9.jpg"/> </div><br>
|
||||
|
||||
广度优先搜索一层一层地进行遍历,每层遍历都以上一层遍历的结果作为起点,遍历一个距离能访问到的所有节点。需要注意的是,遍历过的节点不能再次被遍历。
|
||||
广度优先搜索一层一层地进行遍历,每层遍历都是以上一层遍历的结果作为起点,遍历一个距离能访问到的所有节点。需要注意的是,遍历过的节点不能再次被遍历。
|
||||
|
||||
第一层:
|
||||
|
||||
@ -75,33 +75,39 @@
|
||||
题目描述:0 表示可以经过某个位置,求解从左上角到右下角的最短路径长度。
|
||||
|
||||
```java
|
||||
public int shortestPathBinaryMatrix(int[][] grids) {
|
||||
int[][] direction = {{1, -1}, {1, 0}, {1, 1}, {0, -1}, {0, 1}, {-1, -1}, {-1, 0}, {-1, 1}};
|
||||
int m = grids.length, n = grids[0].length;
|
||||
Queue<Pair<Integer, Integer>> queue = new LinkedList<>();
|
||||
queue.add(new Pair<>(0, 0));
|
||||
int pathLength = 0;
|
||||
while (!queue.isEmpty()) {
|
||||
int size = queue.size();
|
||||
pathLength++;
|
||||
while (size-- > 0) {
|
||||
Pair<Integer, Integer> cur = queue.poll();
|
||||
int cr = cur.getKey(), cc = cur.getValue();
|
||||
grids[cr][cc] = 1; // 标记
|
||||
for (int[] d : direction) {
|
||||
int nr = cr + d[0], nc = cc + d[1];
|
||||
if (nr < 0 || nr >= m || nc < 0 || nc >= n || grids[nr][nc] == 1) {
|
||||
public int shortestPathBinaryMatrix(int[][] grids) {
|
||||
if (grids == null || grids.length == 0 || grids[0].length == 0) {
|
||||
return -1;
|
||||
}
|
||||
int[][] direction = {{1, -1}, {1, 0}, {1, 1}, {0, -1}, {0, 1}, {-1, -1}, {-1, 0}, {-1, 1}};
|
||||
int m = grids.length, n = grids[0].length;
|
||||
Queue<Pair<Integer, Integer>> queue = new LinkedList<>();
|
||||
queue.add(new Pair<>(0, 0));
|
||||
int pathLength = 0;
|
||||
while (!queue.isEmpty()) {
|
||||
int size = queue.size();
|
||||
pathLength++;
|
||||
while (size-- > 0) {
|
||||
Pair<Integer, Integer> cur = queue.poll();
|
||||
int cr = cur.getKey(), cc = cur.getValue();
|
||||
if (grids[cr][cc] == 1) {
|
||||
continue;
|
||||
}
|
||||
if (nr == m - 1 && nc == n - 1) {
|
||||
return pathLength + 1;
|
||||
if (cr == m - 1 && cc == n - 1) {
|
||||
return pathLength;
|
||||
}
|
||||
grids[cr][cc] = 1; // 标记
|
||||
for (int[] d : direction) {
|
||||
int nr = cr + d[0], nc = cc + d[1];
|
||||
if (nr < 0 || nr >= m || nc < 0 || nc >= n) {
|
||||
continue;
|
||||
}
|
||||
queue.add(new Pair<>(nr, nc));
|
||||
}
|
||||
queue.add(new Pair<>(nr, nc));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
```
|
||||
|
||||
## 2. 组成整数的最小平方数数量
|
||||
|
@ -827,7 +827,7 @@ https://leetcode.com/problems/rank-scores/description/
|
||||
| 2 | 4.2 | 2 | 2 |
|
||||
| 3 | 4.3 | 1 | 1 |
|
||||
|
||||
使用连接操作找到某个 score 对应的大于其值的记录:
|
||||
使用连接操作找到某个 score 对应的大于等于其值的记录:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
@ -890,7 +890,7 @@ ORDER BY
|
||||
| score | Rank |
|
||||
| :---: | :--: |
|
||||
| 4.2 | 1 |
|
||||
| 4.2 | 2 |
|
||||
| 4.2 | 1 |
|
||||
| 4.1 | 2 |
|
||||
|
||||
连接情况如下:
|
||||
|
@ -1021,7 +1021,7 @@ g/re/p(globally search a regular expression and print),使用正则表示式
|
||||
|
||||
```html
|
||||
$ grep [-acinv] [--color=auto] 搜寻字符串 filename
|
||||
-c : 统计个数
|
||||
-c : 统计匹配到行的个数
|
||||
-i : 忽略大小写
|
||||
-n : 输出行号
|
||||
-v : 反向选择,也就是显示出没有 搜寻字符串 内容的那一行
|
||||
@ -1039,7 +1039,7 @@ $ grep -n 'the' regular_express.txt
|
||||
18:google is the best tools for search keyword
|
||||
```
|
||||
|
||||
示例:正则表达式 a{m,n} 用来匹配字符 a m\~n 次,这里需要将 { 和 } 进行转移,因为它们在 shell 是有特殊意义的。
|
||||
示例:正则表达式 a{m,n} 用来匹配字符 a m\~n 次,这里需要将 { 和 } 进行转义,因为它们在 shell 是有特殊意义的。
|
||||
|
||||
```html
|
||||
$ grep -n 'a\{2,5\}' regular_express.txt
|
||||
|
@ -1,3 +1,10 @@
|
||||
# 前言
|
||||
|
||||
题目来自《何海涛. 剑指 Offer[M]. 电子工业出版社, 2012.》,刷题网站推荐:
|
||||
|
||||
- [牛客网](https://www.nowcoder.com/ta/coding-interviews?from=cyc_github)
|
||||
- [Leetcode](https://leetcode-cn.com/problemset/lcof/)
|
||||
|
||||
# 目录
|
||||
|
||||
|
||||
@ -78,10 +85,6 @@
|
||||
- [67. 把字符串转换成整数](67.%20把字符串转换成整数.md)
|
||||
- [68. 树中两个节点的最低公共祖先](68.%20树中两个节点的最低公共祖先.md)
|
||||
|
||||
# 参考文献
|
||||
|
||||
何海涛. 剑指 Offer[M]. 电子工业出版社, 2012.
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -73,6 +73,7 @@
|
||||
```
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/eb859228-c0f2-4bce-910d-d9f76929352b.png"/> </div><br>
|
||||
|
||||
## 3. 最近未使用
|
||||
|
||||
> NRU, Not Recently Used
|
||||
@ -88,7 +89,7 @@
|
||||
|
||||
NRU 优先换出已经被修改的脏页面(R=0,M=1),而不是被频繁使用的干净页面(R=1,M=0)。
|
||||
|
||||
## 4. 先进先出
|
||||
## 4. 先进先出
|
||||
|
||||
> FIFO, First In First Out
|
||||
|
||||
|
@ -22,20 +22,53 @@ Output:
|
||||
|
||||
```java
|
||||
public int StrToInt(String str) {
|
||||
if (str == null || str.length() == 0)
|
||||
return 0;
|
||||
boolean isNegative = str.charAt(0) == '-';
|
||||
int ret = 0;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
char c = str.charAt(i);
|
||||
if (i == 0 && (c == '+' || c == '-')) /* 符号判定 */
|
||||
continue;
|
||||
if (c < '0' || c > '9') /* 非法输入 */
|
||||
if (str == null)
|
||||
return 0;
|
||||
ret = ret * 10 + (c - '0');
|
||||
int result = 0;
|
||||
boolean negative = false;//是否负数
|
||||
int i = 0, len = str.length();
|
||||
/**
|
||||
* limit 默认初始化为*负的*最大正整数 ,假如字符串表示的是正数
|
||||
* 由于int的范围为-2147483648~2147483647
|
||||
* 那么result(在返回之前一直是负数形式)就必须和这个最大正数的负数来比较来判断是否溢出,
|
||||
*/
|
||||
int limit = - Integer.MAX_VALUE;
|
||||
int multmin;
|
||||
int digit;
|
||||
|
||||
if (len > 0) {
|
||||
char firstChar = str.charAt(0);//首先看第一位
|
||||
if (firstChar < '0') { // 有可能是 "+" or "-"
|
||||
if (firstChar == '-') {
|
||||
negative = true;
|
||||
limit = Integer.MIN_VALUE;//在负号的情况下,判断溢出的值就变成了 整数的 最小负数了
|
||||
} else if (firstChar != '+')//第一位不是数字和-只能是+
|
||||
return 0;
|
||||
if (len == 1) // Cannot have lone "+" or "-"
|
||||
return 0;
|
||||
i++;
|
||||
}
|
||||
multmin = limit / 10;
|
||||
while (i < len) {
|
||||
digit = str.charAt(i++)-'0';
|
||||
if (digit < 0 || digit > 9)
|
||||
return 0;
|
||||
//判断溢出
|
||||
if (result < multmin) {
|
||||
return 0;
|
||||
}
|
||||
result *= 10;
|
||||
if (result < limit + digit) {
|
||||
return 0;
|
||||
}
|
||||
result -= digit;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
//如果是正数就返回-result(result一直是负数)
|
||||
return negative ? result : -result;
|
||||
}
|
||||
return isNegative ? -ret : ret;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
@ -1432,8 +1432,9 @@ Java 注解是附加在代码中的一些元信息,用于一些工具在编译
|
||||
|
||||
## JRE or JDK
|
||||
|
||||
- JRE is the JVM program, Java application need to run on JRE.
|
||||
- JDK is a superset of JRE, JRE + tools for developing java programs. e.g, it provides the compiler "javac"
|
||||
- JRE:Java Runtime Environment,java运行环境的简称,为java的运行提供了所需的环境。主要包括了JVM的标准实现和一些java基本类库。
|
||||
- JDK:Java Development Kit,java开发工具包,提供了java的开发及运行环境。JDK是java开发的核心,集成了JRE以及一些其他的工具,比如编译 java 源码的编译器 javac等。
|
||||
- 因此可以这样认为:JDK>JRE>JVM,JRE支持了java程序的运行,而JDK则同时支持了java程序的开发。
|
||||
|
||||
# 参考资料
|
||||
|
||||
|
@ -521,7 +521,7 @@ public static final int value = 123;
|
||||
其中解析过程在某些情况下可以在初始化阶段之后再开始,这是为了支持 Java 的动态绑定。
|
||||
|
||||
<div data="补充为什么可以支持动态绑定 --> <--"></div>
|
||||
### 5. 初始化
|
||||
### 5. 初始化
|
||||
|
||||
<div data="modify -->"></div>
|
||||
初始化阶段才真正开始执行类中定义的 Java 程序代码。初始化阶段是虚拟机执行类构造器 <clinit>() 方法的过程。在准备阶段,类变量已经赋过一次系统要求的初始值,而在初始化阶段,根据程序员通过程序制定的主观计划去初始化类变量和其它资源。
|
||||
|
@ -1,4 +1,5 @@
|
||||
<!-- GFM-TOC -->
|
||||
* [0. 原理](#0-原理)
|
||||
* [1. 统计两个数的二进制表示有多少位不同](#1-统计两个数的二进制表示有多少位不同)
|
||||
* [2. 数组中唯一一个不重复的元素](#2-数组中唯一一个不重复的元素)
|
||||
* [3. 找出数组中缺失的那个数](#3-找出数组中缺失的那个数)
|
||||
@ -15,7 +16,9 @@
|
||||
<!-- GFM-TOC -->
|
||||
|
||||
|
||||
**基本原理**
|
||||
# 0. 原理
|
||||
|
||||
**基本原理**
|
||||
|
||||
0s 表示一串 0,1s 表示一串 1。
|
||||
|
||||
@ -25,23 +28,79 @@ x ^ 1s = ~x x & 1s = x x | 1s = 1s
|
||||
x ^ x = 0 x & x = x x | x = x
|
||||
```
|
||||
|
||||
- 利用 x ^ 1s = \~x 的特点,可以将位级表示翻转;利用 x ^ x = 0 的特点,可以将三个数中重复的两个数去除,只留下另一个数。
|
||||
- 利用 x & 0s = 0 和 x & 1s = x 的特点,可以实现掩码操作。一个数 num 与 mask:00111100 进行位与操作,只保留 num 中与 mask 的 1 部分相对应的位。
|
||||
- 利用 x | 0s = x 和 x | 1s = 1s 的特点,可以实现设值操作。一个数 num 与 mask:00111100 进行位或操作,将 num 中与 mask 的 1 部分相对应的位都设置为 1。
|
||||
利用 x ^ 1s = \~x 的特点,可以将一个数的位级表示翻转;利用 x ^ x = 0 的特点,可以将三个数中重复的两个数去除,只留下另一个数。
|
||||
|
||||
位与运算技巧:
|
||||
```
|
||||
1^1^2 = 2
|
||||
```
|
||||
|
||||
- n&(n-1) 去除 n 的位级表示中最低的那一位。例如对于二进制表示 10110100,减去 1 得到 10110011,这两个数相与得到 10110000。
|
||||
- n&(-n) 得到 n 的位级表示中最低的那一位。-n 得到 n 的反码加 1,对于二进制表示 10110100,-n 得到 01001100,相与得到 00000100。
|
||||
- n-n&(\~n+1) 去除 n 的位级表示中最高的那一位。
|
||||
利用 x & 0s = 0 和 x & 1s = x 的特点,可以实现掩码操作。一个数 num 与 mask:00111100 进行位与操作,只保留 num 中与 mask 的 1 部分相对应的位。
|
||||
|
||||
移位运算:
|
||||
```
|
||||
01011011 &
|
||||
00111100
|
||||
--------
|
||||
00011000
|
||||
```
|
||||
|
||||
- \>\> n 为算术右移,相当于除以 2<sup>n</sup>;
|
||||
- \>\>\> n 为无符号右移,左边会补上 0。
|
||||
- << n 为算术左移,相当于乘以 2<sup>n</sup>。
|
||||
利用 x | 0s = x 和 x | 1s = 1s 的特点,可以实现设值操作。一个数 num 与 mask:00111100 进行位或操作,将 num 中与 mask 的 1 部分相对应的位都设置为 1。
|
||||
|
||||
** mask 计算**
|
||||
```
|
||||
01011011 |
|
||||
00111100
|
||||
--------
|
||||
01111111
|
||||
```
|
||||
|
||||
**位与运算技巧**
|
||||
|
||||
n&(n-1) 去除 n 的位级表示中最低的那一位 1。例如对于二进制表示 01011011,减去 1 得到 01011010,这两个数相与得到 01011010。
|
||||
|
||||
```
|
||||
01011011 &
|
||||
01011010
|
||||
--------
|
||||
01011010
|
||||
```
|
||||
|
||||
n&(-n) 得到 n 的位级表示中最低的那一位 1。-n 得到 n 的反码加 1,也就是 -n=\~n+1。例如对于二进制表示 10110100,-n 得到 01001100,相与得到 00000100。
|
||||
|
||||
```
|
||||
10110100 &
|
||||
01001100
|
||||
--------
|
||||
00000100
|
||||
```
|
||||
|
||||
n-(n&(-n)) 则可以去除 n 的位级表示中最低的那一位 1,和 n&(n-1) 效果一样。
|
||||
|
||||
**移位运算**
|
||||
|
||||
\>\> n 为算术右移,相当于除以 2<sup>n</sup>,例如 -7 >> 2 = -2。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 >> 2
|
||||
--------
|
||||
11111111111111111111111111111110
|
||||
```
|
||||
|
||||
\>\>\> n 为无符号右移,左边会补上 0。例如 -7 >>> 2 = 1073741822。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 >>> 2
|
||||
--------
|
||||
00111111111111111111111111111111
|
||||
```
|
||||
|
||||
<< n 为算术左移,相当于乘以 2<sup>n</sup>。-7 << 2 = -28。
|
||||
|
||||
```
|
||||
11111111111111111111111111111001 << 2
|
||||
--------
|
||||
11111111111111111111111111100100
|
||||
```
|
||||
|
||||
**mask 计算**
|
||||
|
||||
要获取 111111111,将 0 取反即可,\~0。
|
||||
|
||||
|
@ -139,7 +139,7 @@ private int rob(int[] nums, int first, int last) {
|
||||
|
||||
## 4. 信件错排
|
||||
|
||||
题目描述:有 N 个 信 和 信封,它们被打乱,求错误装信方式的数量。
|
||||
题目描述:有 N 个 信 和 信封,它们被打乱,求错误装信方式的数量(所有信封都没有装各自的信)。
|
||||
|
||||
定义一个数组 dp 存储错误方式数量,dp[i] 表示前 i 个信和信封的错误方式数量。假设第 i 个信装到第 j 个信封里面,而第 j 个信装到第 k 个信封里面。根据 i 和 k 是否相等,有两种情况:
|
||||
|
||||
@ -1055,7 +1055,10 @@ public int combinationSum4(int[] nums, int target) {
|
||||
|
||||
题目描述:交易之后需要有一天的冷却时间。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/ffd96b99-8009-487c-8e98-11c9d44ef14f.png" width="300px"> </div><br>
|
||||
|
||||
该题为马尔可夫过程,分为A观望,B持股,C冷却三个状态
|
||||
状态转移图:A-(观望)->A, A-(买入|-price)->B, B-(观望)->B, B-(卖出|+price)->C, C-(冷却)->A
|
||||
可用维特比算法求解
|
||||
|
||||
```java
|
||||
public int maxProfit(int[] prices) {
|
||||
@ -1063,19 +1066,17 @@ public int maxProfit(int[] prices) {
|
||||
return 0;
|
||||
}
|
||||
int N = prices.length;
|
||||
int[] buy = new int[N];
|
||||
int[] s1 = new int[N];
|
||||
int[] sell = new int[N];
|
||||
int[] s2 = new int[N];
|
||||
s1[0] = buy[0] = -prices[0];
|
||||
sell[0] = s2[0] = 0;
|
||||
int[] A = new int[N];
|
||||
int[] B = new int[N];
|
||||
int[] C = new int[N];
|
||||
A[0] = 0;
|
||||
B[0] = C[0] = -prices[0];
|
||||
for (int i = 1; i < N; i++) {
|
||||
buy[i] = s2[i - 1] - prices[i];
|
||||
s1[i] = Math.max(buy[i - 1], s1[i - 1]);
|
||||
sell[i] = Math.max(buy[i - 1], s1[i - 1]) + prices[i];
|
||||
s2[i] = Math.max(s2[i - 1], sell[i - 1]);
|
||||
A[i] = Math.max(A[i - 1], C[i - 1]);
|
||||
B[i] = Math.max(B[i - 1], A[i - 1] - prices[i]);
|
||||
C[i] = B[i - 1] + prices[i];
|
||||
}
|
||||
return Math.max(sell[N - 1], s2[N - 1]);
|
||||
return Math.max(A[N - 1], C[N - 1]);
|
||||
}
|
||||
```
|
||||
|
||||
@ -1098,24 +1099,22 @@ The total profit is ((8 - 1) - 2) + ((9 - 4) - 2) = 8.
|
||||
|
||||
题目描述:每交易一次,都要支付一定的费用。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/1e2c588c-72b7-445e-aacb-d55dc8a88c29.png" width="300px"> </div><br>
|
||||
|
||||
分为A观望,B持股,两个状态
|
||||
状态转移图:A-(观望)->A, A-(买入|-price)->B, B-(观望)->B, B-(卖出|+price|-fee)->A
|
||||
|
||||
```java
|
||||
public int maxProfit(int[] prices, int fee) {
|
||||
int N = prices.length;
|
||||
int[] buy = new int[N];
|
||||
int[] s1 = new int[N];
|
||||
int[] sell = new int[N];
|
||||
int[] s2 = new int[N];
|
||||
s1[0] = buy[0] = -prices[0];
|
||||
sell[0] = s2[0] = 0;
|
||||
int[] A = new int[N];
|
||||
int[] B = new int[N];
|
||||
A[0] = 0;
|
||||
B[0] = -prices[0];
|
||||
for (int i = 1; i < N; i++) {
|
||||
buy[i] = Math.max(sell[i - 1], s2[i - 1]) - prices[i];
|
||||
s1[i] = Math.max(buy[i - 1], s1[i - 1]);
|
||||
sell[i] = Math.max(buy[i - 1], s1[i - 1]) - fee + prices[i];
|
||||
s2[i] = Math.max(s2[i - 1], sell[i - 1]);
|
||||
A[i] = Math.max(A[i - 1], B[i - 1] + prices[i] -fee);
|
||||
B[i] = Math.max(A[i - 1] - prices[i], B[i - 1]);
|
||||
}
|
||||
return Math.max(sell[N - 1], s2[N - 1]);
|
||||
return A[N - 1];
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/95903878-725b-4ed9-bded-bc4aae0792a9.jpg"/> </div><br>
|
||||
|
||||
广度优先搜索一层一层地进行遍历,每层遍历都以上一层遍历的结果作为起点,遍历一个距离能访问到的所有节点。需要注意的是,遍历过的节点不能再次被遍历。
|
||||
广度优先搜索一层一层地进行遍历,每层遍历都是以上一层遍历的结果作为起点,遍历一个距离能访问到的所有节点。需要注意的是,遍历过的节点不能再次被遍历。
|
||||
|
||||
第一层:
|
||||
|
||||
@ -75,33 +75,39 @@
|
||||
题目描述:0 表示可以经过某个位置,求解从左上角到右下角的最短路径长度。
|
||||
|
||||
```java
|
||||
public int shortestPathBinaryMatrix(int[][] grids) {
|
||||
int[][] direction = {{1, -1}, {1, 0}, {1, 1}, {0, -1}, {0, 1}, {-1, -1}, {-1, 0}, {-1, 1}};
|
||||
int m = grids.length, n = grids[0].length;
|
||||
Queue<Pair<Integer, Integer>> queue = new LinkedList<>();
|
||||
queue.add(new Pair<>(0, 0));
|
||||
int pathLength = 0;
|
||||
while (!queue.isEmpty()) {
|
||||
int size = queue.size();
|
||||
pathLength++;
|
||||
while (size-- > 0) {
|
||||
Pair<Integer, Integer> cur = queue.poll();
|
||||
int cr = cur.getKey(), cc = cur.getValue();
|
||||
grids[cr][cc] = 1; // 标记
|
||||
for (int[] d : direction) {
|
||||
int nr = cr + d[0], nc = cc + d[1];
|
||||
if (nr < 0 || nr >= m || nc < 0 || nc >= n || grids[nr][nc] == 1) {
|
||||
public int shortestPathBinaryMatrix(int[][] grids) {
|
||||
if (grids == null || grids.length == 0 || grids[0].length == 0) {
|
||||
return -1;
|
||||
}
|
||||
int[][] direction = {{1, -1}, {1, 0}, {1, 1}, {0, -1}, {0, 1}, {-1, -1}, {-1, 0}, {-1, 1}};
|
||||
int m = grids.length, n = grids[0].length;
|
||||
Queue<Pair<Integer, Integer>> queue = new LinkedList<>();
|
||||
queue.add(new Pair<>(0, 0));
|
||||
int pathLength = 0;
|
||||
while (!queue.isEmpty()) {
|
||||
int size = queue.size();
|
||||
pathLength++;
|
||||
while (size-- > 0) {
|
||||
Pair<Integer, Integer> cur = queue.poll();
|
||||
int cr = cur.getKey(), cc = cur.getValue();
|
||||
if (grids[cr][cc] == 1) {
|
||||
continue;
|
||||
}
|
||||
if (nr == m - 1 && nc == n - 1) {
|
||||
return pathLength + 1;
|
||||
if (cr == m - 1 && cc == n - 1) {
|
||||
return pathLength;
|
||||
}
|
||||
grids[cr][cc] = 1; // 标记
|
||||
for (int[] d : direction) {
|
||||
int nr = cr + d[0], nc = cc + d[1];
|
||||
if (nr < 0 || nr >= m || nc < 0 || nc >= n) {
|
||||
continue;
|
||||
}
|
||||
queue.add(new Pair<>(nr, nc));
|
||||
}
|
||||
queue.add(new Pair<>(nr, nc));
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
```
|
||||
|
||||
## 2. 组成整数的最小平方数数量
|
||||
|
@ -827,7 +827,7 @@ https://leetcode.com/problems/rank-scores/description/
|
||||
| 2 | 4.2 | 2 | 2 |
|
||||
| 3 | 4.3 | 1 | 1 |
|
||||
|
||||
使用连接操作找到某个 score 对应的大于其值的记录:
|
||||
使用连接操作找到某个 score 对应的大于等于其值的记录:
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
@ -890,7 +890,7 @@ ORDER BY
|
||||
| score | Rank |
|
||||
| :---: | :--: |
|
||||
| 4.2 | 1 |
|
||||
| 4.2 | 2 |
|
||||
| 4.2 | 1 |
|
||||
| 4.1 | 2 |
|
||||
|
||||
连接情况如下:
|
||||
|
@ -1021,7 +1021,7 @@ g/re/p(globally search a regular expression and print),使用正则表示式
|
||||
|
||||
```html
|
||||
$ grep [-acinv] [--color=auto] 搜寻字符串 filename
|
||||
-c : 统计个数
|
||||
-c : 统计匹配到行的个数
|
||||
-i : 忽略大小写
|
||||
-n : 输出行号
|
||||
-v : 反向选择,也就是显示出没有 搜寻字符串 内容的那一行
|
||||
@ -1039,7 +1039,7 @@ $ grep -n 'the' regular_express.txt
|
||||
18:google is the best tools for search keyword
|
||||
```
|
||||
|
||||
示例:正则表达式 a{m,n} 用来匹配字符 a m\~n 次,这里需要将 { 和 } 进行转移,因为它们在 shell 是有特殊意义的。
|
||||
示例:正则表达式 a{m,n} 用来匹配字符 a m\~n 次,这里需要将 { 和 } 进行转义,因为它们在 shell 是有特殊意义的。
|
||||
|
||||
```html
|
||||
$ grep -n 'a\{2,5\}' regular_express.txt
|
||||
|
@ -1,3 +1,10 @@
|
||||
# 前言
|
||||
|
||||
题目来自《何海涛. 剑指 Offer[M]. 电子工业出版社, 2012.》,刷题网站推荐:
|
||||
|
||||
- [牛客网](https://www.nowcoder.com/ta/coding-interviews?from=cyc_github)
|
||||
- [Leetcode](https://leetcode-cn.com/problemset/lcof/)
|
||||
|
||||
# 目录
|
||||
|
||||
|
||||
@ -78,10 +85,6 @@
|
||||
- [67. 把字符串转换成整数](67.%20把字符串转换成整数.md)
|
||||
- [68. 树中两个节点的最低公共祖先](68.%20树中两个节点的最低公共祖先.md)
|
||||
|
||||
# 参考文献
|
||||
|
||||
何海涛. 剑指 Offer[M]. 电子工业出版社, 2012.
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -73,6 +73,7 @@
|
||||
```
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/eb859228-c0f2-4bce-910d-d9f76929352b.png"/> </div><br>
|
||||
|
||||
## 3. 最近未使用
|
||||
|
||||
> NRU, Not Recently Used
|
||||
@ -88,7 +89,7 @@
|
||||
|
||||
NRU 优先换出已经被修改的脏页面(R=0,M=1),而不是被频繁使用的干净页面(R=1,M=0)。
|
||||
|
||||
## 4. 先进先出
|
||||
## 4. 先进先出
|
||||
|
||||
> FIFO, First In First Out
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
- 其他人添加的全新内容
|
||||
- 其他人的项目推广
|
||||
|
||||
|
||||
- 其他人添加的全新内容
|
||||
- 其他人的项目推广
|
||||
|
||||
|
||||
|
@ -1,37 +1,37 @@
|
||||
# LeetCode 面试必备
|
||||
- 💪 就是干!如果你觉得有帮助请点个star,谢谢!
|
||||
|
||||
> **欢迎任何人参与和完善:一个人可以走的很快,但是一群人却可以走的更远**
|
||||
|
||||
## LeetCode 习题集合
|
||||
|
||||
* [LeetCode 解题集合](https://github.com/apachecn/LeetCode/tree/master/docs/Leetcode_Solutions)
|
||||
|
||||
|
||||
## 模版要求
|
||||
|
||||
> 提交PR基本要求(满足任意一种即可)
|
||||
|
||||
* 1. 不一样的思路
|
||||
* 2. 优化时间复杂度和空间复杂度,或者解决题目的Follow up
|
||||
* 3. 有意义的简化代码
|
||||
* 4. 未提交过的题目
|
||||
|
||||
> **案例模版**
|
||||
|
||||
[模版:007. Reverse Integer 反转整数](https://github.com/apachecn/LeetCode/tree/master/docs/Leetcode_Solutions/007._Reverse_Integer.md)
|
||||
|
||||
|
||||
## 项目贡献者
|
||||
|
||||
> 项目发起人
|
||||
|
||||
* [@Lisanaaa](https://github.com/Lisanaaa)
|
||||
* [@片刻](https://github.com/jiangzhonglian)
|
||||
|
||||
> 贡献者(欢迎大家来追加)
|
||||
|
||||
* [@Lisanaaa](https://github.com/Lisanaaa)
|
||||
* [@片刻](https://github.com/jiangzhonglian)
|
||||
* [@小瑶](https://github.com/chenyyx)
|
||||
|
||||
# LeetCode 面试必备
|
||||
- 💪 就是干!如果你觉得有帮助请点个star,谢谢!
|
||||
|
||||
> **欢迎任何人参与和完善:一个人可以走的很快,但是一群人却可以走的更远**
|
||||
|
||||
## LeetCode 习题集合
|
||||
|
||||
* [LeetCode 解题集合](https://github.com/apachecn/LeetCode/tree/master/docs/Leetcode_Solutions)
|
||||
|
||||
|
||||
## 模版要求
|
||||
|
||||
> 提交PR基本要求(满足任意一种即可)
|
||||
|
||||
* 1. 不一样的思路
|
||||
* 2. 优化时间复杂度和空间复杂度,或者解决题目的Follow up
|
||||
* 3. 有意义的简化代码
|
||||
* 4. 未提交过的题目
|
||||
|
||||
> **案例模版**
|
||||
|
||||
[模版:007. Reverse Integer 反转整数](https://github.com/apachecn/LeetCode/tree/master/docs/Leetcode_Solutions/007._Reverse_Integer.md)
|
||||
|
||||
|
||||
## 项目贡献者
|
||||
|
||||
> 项目发起人
|
||||
|
||||
* [@Lisanaaa](https://github.com/Lisanaaa)
|
||||
* [@片刻](https://github.com/jiangzhonglian)
|
||||
|
||||
> 贡献者(欢迎大家来追加)
|
||||
|
||||
* [@Lisanaaa](https://github.com/Lisanaaa)
|
||||
* [@片刻](https://github.com/jiangzhonglian)
|
||||
* [@小瑶](https://github.com/chenyyx)
|
||||
|
||||
|
@ -1,132 +1,132 @@
|
||||
[中文](https://github.com/haizlin/fe-interview/blob/master/README.md) | [English](https://github.com/haizlin/fe-interview/blob/master/README-en.md)
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=html" alt="html"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=css" alt="css"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=javascript" alt="javascript"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=skill" alt="skill"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/stargazers"><img src="https://img.shields.io/redmine/plugin/stars/redmine_xlsx_format_issue_exporter.svg" alt="Statr"></a>
|
||||
</p>
|
||||
|
||||
**非常感谢CS-Notes**
|
||||
**参与每日面试答题,可以移步到: https://github.com/haizlin/fe-interview**
|
||||
|
||||
# 前端面试每日 **3+1**(每日三问)
|
||||
|
||||
> 《论语》,曾子曰:**“吾日三省吾身”**(我每天多次反省自己)。
|
||||
> 前端面试每日3+1,以面试题来驱动学习,每天进步一点!
|
||||
> 让努力成为一种习惯,让奋斗成为一种享受!
|
||||
> 相信 **坚持** 的力量!!!
|
||||
|
||||
---
|
||||
- 学习不打烊,充电加油只为**遇到更好的自己**,365天无节假日,每天早上5点纯手工发布面试题(**死磕自己,愉悦大家**)。
|
||||
- 希望大家在这**浮夸**的前端圈里,保持**冷静**,坚持每天花20分钟来学习与思考。
|
||||
- 在这千变万化,类库层出不穷的前端,建议大家不要等到找工作时,才狂刷题,提倡**每日学习**!(**不忘初心**,html、css、javascript才是基石!)
|
||||
- 欢迎大家到**Issues**交流,鼓励**PR**,感谢**Star**,大家有啥好的建议可以加我微信一起交流讨论!
|
||||
> 希望大家**每日**去学习与思考,这才达到来这里的目的!!!(不要为了谁而来,要为自己而来!)
|
||||
|
||||
## 今天的面试题 (2019.05.21) —— 第35天
|
||||
- [html] [用一个div模拟textarea的实现](https://github.com/haizlin/fe-interview/issues/128)
|
||||
- [css] [使用flex实现三栏布局,两边固定,中间自适应](https://github.com/haizlin/fe-interview/issues/129)
|
||||
- [js] [请你解释一个为什么10.toFixed(10)会报错?](https://github.com/haizlin/fe-interview/issues/130)
|
||||
- [软技能] [谈一谈你知道的前端性能优化方案有哪些?](https://github.com/haizlin/fe-interview/issues/131)
|
||||
|
||||
> 欢迎在 [**Issues**](https://github.com/haizlin/fe-interview/issues) 和朋友们一同讨论学习!
|
||||
|
||||
## 试题分类
|
||||
- 分类(3+1)
|
||||
[html](https://github.com/haizlin/fe-interview/category/html.md) | [css](https://github.com/haizlin/fe-interview/category/css.md) | [js](https://github.com/haizlin/fe-interview/category/js.md) | [软技能](https://github.com/haizlin/fe-interview/category/skill.md)
|
||||
|
||||
- 专题(敬请期待、欢迎PR)
|
||||
[ES6](https://github.com/haizlin/fe-interview/category/es6.md) | [jQuery](https://github.com/haizlin/fe-interview/lib/jQuery.md) | [Vue](https://github.com/haizlin/fe-interview/lib/Vue.md) | [React](https://github.com/haizlin/fe-interview/lib/React.md) | [AngularJs](https://github.com/haizlin/fe-interview/lib/AngularJs.md) | [小程序](https://github.com/haizlin/fe-interview/lib/wxapp.md)
|
||||
|
||||
- 汇总
|
||||
[周](https://github.com/haizlin/fe-interview/category/week.md)
|
||||
|
||||
## 历史面试题
|
||||
- **[查看全部](category/history.md)**
|
||||
|
||||
- 第34天 (2019.05.20)
|
||||
- [html] [Standards模式和Quirks模式有什么区别?](https://github.com/haizlin/fe-interview/issues/122)
|
||||
- [css] [浏览器是怎样判断元素是否和某个CSS选择器匹配?](https://github.com/haizlin/fe-interview/issues/123)
|
||||
- [js] [请用canvas写一个关于520浪漫表白的代码](https://github.com/haizlin/fe-interview/issues/124)
|
||||
- [软技能] [你了解什么是技术债务吗?](https://github.com/haizlin/fe-interview/issues/125)
|
||||
|
||||
- 第33天 (2019.05.19)
|
||||
- [html] [html和html5有什么区别呢?](https://github.com/haizlin/fe-interview/issues/118)
|
||||
- [css] [用CSS绘制一个三角形](https://github.com/haizlin/fe-interview/issues/119)
|
||||
- [js] [说说你对this的理解](https://github.com/haizlin/fe-interview/issues/120)
|
||||
- [软技能] [你对全栈工程师的理解是什么?](https://github.com/haizlin/fe-interview/issues/121)
|
||||
|
||||
- 第32天 (2019.05.18)
|
||||
- [html] [说说你对HTML元素的显示优先级的理解](https://github.com/haizlin/fe-interview/issues/114)
|
||||
- [css] [说下line-height三种赋值方式有何区别?](https://github.com/haizlin/fe-interview/issues/115)
|
||||
- [js] [造成内存泄漏的操作有哪些?](https://github.com/haizlin/fe-interview/issues/116)
|
||||
- [软技能] [你在上一家公司工作流程是怎么样的,如何与其他人协作的?是怎样跨部门合作的?](https://github.com/haizlin/fe-interview/issues/117)
|
||||
|
||||
- 第31天 (2019.05.17)
|
||||
- [html] [DOM和BOM有什么区别?](https://github.com/haizlin/fe-interview/issues/110)
|
||||
- [css] [让网页的字体变得清晰,变细用CSS怎么做?](https://github.com/haizlin/fe-interview/issues/111)
|
||||
- [js] [写一个方法把0和1互转(0置1,1置0)](https://github.com/haizlin/fe-interview/issues/112)
|
||||
- [软技能] [对于有压力时,你是怎么抗压的?](https://github.com/haizlin/fe-interview/issues/113)
|
||||
|
||||
- 第30天 (2019.05.16)
|
||||
- [html] [网页上的验证码是为了解决什么问题?说说你了解的验证码种类有哪些](https://github.com/haizlin/fe-interview/issues/106)
|
||||
- [css] [描述下你所了解的图片格式及使用场景](https://github.com/haizlin/fe-interview/issues/107)
|
||||
- [js] [写一个方法判断字符串是否为回文字符串](https://github.com/haizlin/fe-interview/issues/108)
|
||||
- [软技能] [解释下CRLF是什么?](https://github.com/haizlin/fe-interview/issues/109)
|
||||
|
||||
- **[查看全部](category/history.md)**
|
||||
|
||||
## 怎样学习
|
||||
- 不管题目懂与不懂都要先思考再百度,思考后一定要去写出来
|
||||
- 如果是原生js的题,不要依赖第三方库,如jquery等
|
||||
- 每天的题目都是独立的,不需要按顺序来,但建议每道题都去答下,有你会的和有你不会的,答了才知道
|
||||
- 不懂的题百度后,不要直接复制一大段过来,要用自己的话精简地总结概括出来
|
||||
|
||||
## 起源
|
||||
> 故事起源于离职同事发来的一道求助面试题,然后在部门企业微信群里炸开了,答题完后大家觉得如果要是每天来一题,是不是会更爽呢?**以面代练**,突发其想说干就干,所以就有了这个开源仓库,只为利他利己!
|
||||
|
||||

|
||||
|
||||
## 特别感谢(排名不分先后)
|
||||
- [qq674785876](https://github.com/qq674785876)
|
||||
- [undefinedYu](https://github.com/undefinedYu)
|
||||
- [qingleizhang123](https://github.com/qingleizhang123)
|
||||
- [yxkhaha](https://github.com/yxkhaha)
|
||||
|
||||
## 重大事件
|
||||
- 2019.04.17 — 来源于一张离职同事发来的求助面试题,然后大家突发其想说干就干
|
||||
- 2019.04.25 — 添加了面试题的分类
|
||||
- 2019.04.27 — 添加了Issues的模板
|
||||
- 2019.04.28 — 每日3题改成每日3+1,即添加了一个软技能题
|
||||
- 2019.04.29 — 添加了特别感谢的朋友
|
||||
- 2019.04.30 — 添加了QQ讨论群
|
||||
- 2019.05.02 — 去除QQ讨论群二维码,添加公众号及个人微信二维码
|
||||
- 2019.05.05 — 看到很多网络上的朋友滥用链接,让有需要的朋友找不到最新的试题,特添加了转载说明
|
||||
- 2019.05.07 — 为了把开源项目更好的延续下去,帮助更多爱学习的朋友,开通了掘金专栏、知乎专栏和看云
|
||||
- 2019.05.07 — 下午star数突破100,看来爱学习的人很多,也为自己的坚持而感到欣慰!利他利已!
|
||||
- 2019.05.08 — 看到点赞数破100了,但每天答题的人很少很少!我在反思问题出在我身上还是什么原因?所有特加了提示:不要为了谁而来,要为自己而来!
|
||||
- 2019.05.12 — 与国际接轨,代码与学习无国界,所以添加了英文版本,后续会继续优化,先解决有的问题!
|
||||
- 2019.05.13 — star数突破300!
|
||||
- 2019.05.14 — issues题目数量突破100!继续努力前行!
|
||||
- 2019.05.15 — 加了技能图标,让README更美观,看着更舒服!
|
||||
- 2019.05.16 — 看到很多朋友直接复制一大段出来文字放到issues里,其实这样是不好的,看后也要用自己的话总结根据出来,所有添加了怎样学习的方法
|
||||
|
||||
## 在哪可以看到
|
||||
- [掘金专栏](https://juejin.im/user/5b5ff865f265da0f6b771700/posts)(每天同步更新)
|
||||
- [知乎专栏](https://zhuanlan.zhihu.com/fe-interview)(每天同步更新)
|
||||
- [Gitee](https://gitee.com/haizhilin/fe-interview)(每天同步更新)
|
||||
- [看云](https://www.kancloud.cn/aya001001/fe-interview)(每周同步更新)
|
||||
- 「前端剑解」 微信公众号(扫描下方二维码,每天同步更新)
|
||||
|
||||
## 转载说明
|
||||
> 近期,看到很多网络上的朋友滥用链接,包装了下就收费了,让有需要的朋友找不到最新的试题,违背了我的初衷,特添加了些声明:
|
||||
|
||||
- 声明
|
||||
1. 可以转载里面的所有面试题用到任何地方,但请添加仓库的地址,因为转载后你们很少会更新了,但此仓库每天都会准时更新。
|
||||
2. 此开源仓库从不收取任何费用,**现在不会,以后也不会**,也不会授权任何人/机构进行收费。
|
||||
3. 大家不需要对此仓库进行爬虫,如有需要什么格式的,可以私聊我,比如本地阅读的PDF,我有时间会做成PDF的,方便大家!
|
||||
|
||||
## License
|
||||
[中文](https://github.com/haizlin/fe-interview/blob/master/README.md) | [English](https://github.com/haizlin/fe-interview/blob/master/README-en.md)
|
||||
|
||||
<p align="left">
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=html" alt="html"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=css" alt="css"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=javascript" alt="javascript"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/issues"><img src="https://img.shields.io/github/languages/top/badges/shields.svg?label=skill" alt="skill"></a>
|
||||
<a href="https://github.com/haizlin/fe-interview/stargazers"><img src="https://img.shields.io/redmine/plugin/stars/redmine_xlsx_format_issue_exporter.svg" alt="Statr"></a>
|
||||
</p>
|
||||
|
||||
**非常感谢CS-Notes**
|
||||
**参与每日面试答题,可以移步到: https://github.com/haizlin/fe-interview**
|
||||
|
||||
# 前端面试每日 **3+1**(每日三问)
|
||||
|
||||
> 《论语》,曾子曰:**“吾日三省吾身”**(我每天多次反省自己)。
|
||||
> 前端面试每日3+1,以面试题来驱动学习,每天进步一点!
|
||||
> 让努力成为一种习惯,让奋斗成为一种享受!
|
||||
> 相信 **坚持** 的力量!!!
|
||||
|
||||
---
|
||||
- 学习不打烊,充电加油只为**遇到更好的自己**,365天无节假日,每天早上5点纯手工发布面试题(**死磕自己,愉悦大家**)。
|
||||
- 希望大家在这**浮夸**的前端圈里,保持**冷静**,坚持每天花20分钟来学习与思考。
|
||||
- 在这千变万化,类库层出不穷的前端,建议大家不要等到找工作时,才狂刷题,提倡**每日学习**!(**不忘初心**,html、css、javascript才是基石!)
|
||||
- 欢迎大家到**Issues**交流,鼓励**PR**,感谢**Star**,大家有啥好的建议可以加我微信一起交流讨论!
|
||||
> 希望大家**每日**去学习与思考,这才达到来这里的目的!!!(不要为了谁而来,要为自己而来!)
|
||||
|
||||
## 今天的面试题 (2019.05.21) —— 第35天
|
||||
- [html] [用一个div模拟textarea的实现](https://github.com/haizlin/fe-interview/issues/128)
|
||||
- [css] [使用flex实现三栏布局,两边固定,中间自适应](https://github.com/haizlin/fe-interview/issues/129)
|
||||
- [js] [请你解释一个为什么10.toFixed(10)会报错?](https://github.com/haizlin/fe-interview/issues/130)
|
||||
- [软技能] [谈一谈你知道的前端性能优化方案有哪些?](https://github.com/haizlin/fe-interview/issues/131)
|
||||
|
||||
> 欢迎在 [**Issues**](https://github.com/haizlin/fe-interview/issues) 和朋友们一同讨论学习!
|
||||
|
||||
## 试题分类
|
||||
- 分类(3+1)
|
||||
[html](https://github.com/haizlin/fe-interview/category/html.md) | [css](https://github.com/haizlin/fe-interview/category/css.md) | [js](https://github.com/haizlin/fe-interview/category/js.md) | [软技能](https://github.com/haizlin/fe-interview/category/skill.md)
|
||||
|
||||
- 专题(敬请期待、欢迎PR)
|
||||
[ES6](https://github.com/haizlin/fe-interview/category/es6.md) | [jQuery](https://github.com/haizlin/fe-interview/lib/jQuery.md) | [Vue](https://github.com/haizlin/fe-interview/lib/Vue.md) | [React](https://github.com/haizlin/fe-interview/lib/React.md) | [AngularJs](https://github.com/haizlin/fe-interview/lib/AngularJs.md) | [小程序](https://github.com/haizlin/fe-interview/lib/wxapp.md)
|
||||
|
||||
- 汇总
|
||||
[周](https://github.com/haizlin/fe-interview/category/week.md)
|
||||
|
||||
## 历史面试题
|
||||
- **[查看全部](category/history.md)**
|
||||
|
||||
- 第34天 (2019.05.20)
|
||||
- [html] [Standards模式和Quirks模式有什么区别?](https://github.com/haizlin/fe-interview/issues/122)
|
||||
- [css] [浏览器是怎样判断元素是否和某个CSS选择器匹配?](https://github.com/haizlin/fe-interview/issues/123)
|
||||
- [js] [请用canvas写一个关于520浪漫表白的代码](https://github.com/haizlin/fe-interview/issues/124)
|
||||
- [软技能] [你了解什么是技术债务吗?](https://github.com/haizlin/fe-interview/issues/125)
|
||||
|
||||
- 第33天 (2019.05.19)
|
||||
- [html] [html和html5有什么区别呢?](https://github.com/haizlin/fe-interview/issues/118)
|
||||
- [css] [用CSS绘制一个三角形](https://github.com/haizlin/fe-interview/issues/119)
|
||||
- [js] [说说你对this的理解](https://github.com/haizlin/fe-interview/issues/120)
|
||||
- [软技能] [你对全栈工程师的理解是什么?](https://github.com/haizlin/fe-interview/issues/121)
|
||||
|
||||
- 第32天 (2019.05.18)
|
||||
- [html] [说说你对HTML元素的显示优先级的理解](https://github.com/haizlin/fe-interview/issues/114)
|
||||
- [css] [说下line-height三种赋值方式有何区别?](https://github.com/haizlin/fe-interview/issues/115)
|
||||
- [js] [造成内存泄漏的操作有哪些?](https://github.com/haizlin/fe-interview/issues/116)
|
||||
- [软技能] [你在上一家公司工作流程是怎么样的,如何与其他人协作的?是怎样跨部门合作的?](https://github.com/haizlin/fe-interview/issues/117)
|
||||
|
||||
- 第31天 (2019.05.17)
|
||||
- [html] [DOM和BOM有什么区别?](https://github.com/haizlin/fe-interview/issues/110)
|
||||
- [css] [让网页的字体变得清晰,变细用CSS怎么做?](https://github.com/haizlin/fe-interview/issues/111)
|
||||
- [js] [写一个方法把0和1互转(0置1,1置0)](https://github.com/haizlin/fe-interview/issues/112)
|
||||
- [软技能] [对于有压力时,你是怎么抗压的?](https://github.com/haizlin/fe-interview/issues/113)
|
||||
|
||||
- 第30天 (2019.05.16)
|
||||
- [html] [网页上的验证码是为了解决什么问题?说说你了解的验证码种类有哪些](https://github.com/haizlin/fe-interview/issues/106)
|
||||
- [css] [描述下你所了解的图片格式及使用场景](https://github.com/haizlin/fe-interview/issues/107)
|
||||
- [js] [写一个方法判断字符串是否为回文字符串](https://github.com/haizlin/fe-interview/issues/108)
|
||||
- [软技能] [解释下CRLF是什么?](https://github.com/haizlin/fe-interview/issues/109)
|
||||
|
||||
- **[查看全部](category/history.md)**
|
||||
|
||||
## 怎样学习
|
||||
- 不管题目懂与不懂都要先思考再百度,思考后一定要去写出来
|
||||
- 如果是原生js的题,不要依赖第三方库,如jquery等
|
||||
- 每天的题目都是独立的,不需要按顺序来,但建议每道题都去答下,有你会的和有你不会的,答了才知道
|
||||
- 不懂的题百度后,不要直接复制一大段过来,要用自己的话精简地总结概括出来
|
||||
|
||||
## 起源
|
||||
> 故事起源于离职同事发来的一道求助面试题,然后在部门企业微信群里炸开了,答题完后大家觉得如果要是每天来一题,是不是会更爽呢?**以面代练**,突发其想说干就干,所以就有了这个开源仓库,只为利他利己!
|
||||
|
||||

|
||||
|
||||
## 特别感谢(排名不分先后)
|
||||
- [qq674785876](https://github.com/qq674785876)
|
||||
- [undefinedYu](https://github.com/undefinedYu)
|
||||
- [qingleizhang123](https://github.com/qingleizhang123)
|
||||
- [yxkhaha](https://github.com/yxkhaha)
|
||||
|
||||
## 重大事件
|
||||
- 2019.04.17 — 来源于一张离职同事发来的求助面试题,然后大家突发其想说干就干
|
||||
- 2019.04.25 — 添加了面试题的分类
|
||||
- 2019.04.27 — 添加了Issues的模板
|
||||
- 2019.04.28 — 每日3题改成每日3+1,即添加了一个软技能题
|
||||
- 2019.04.29 — 添加了特别感谢的朋友
|
||||
- 2019.04.30 — 添加了QQ讨论群
|
||||
- 2019.05.02 — 去除QQ讨论群二维码,添加公众号及个人微信二维码
|
||||
- 2019.05.05 — 看到很多网络上的朋友滥用链接,让有需要的朋友找不到最新的试题,特添加了转载说明
|
||||
- 2019.05.07 — 为了把开源项目更好的延续下去,帮助更多爱学习的朋友,开通了掘金专栏、知乎专栏和看云
|
||||
- 2019.05.07 — 下午star数突破100,看来爱学习的人很多,也为自己的坚持而感到欣慰!利他利已!
|
||||
- 2019.05.08 — 看到点赞数破100了,但每天答题的人很少很少!我在反思问题出在我身上还是什么原因?所有特加了提示:不要为了谁而来,要为自己而来!
|
||||
- 2019.05.12 — 与国际接轨,代码与学习无国界,所以添加了英文版本,后续会继续优化,先解决有的问题!
|
||||
- 2019.05.13 — star数突破300!
|
||||
- 2019.05.14 — issues题目数量突破100!继续努力前行!
|
||||
- 2019.05.15 — 加了技能图标,让README更美观,看着更舒服!
|
||||
- 2019.05.16 — 看到很多朋友直接复制一大段出来文字放到issues里,其实这样是不好的,看后也要用自己的话总结根据出来,所有添加了怎样学习的方法
|
||||
|
||||
## 在哪可以看到
|
||||
- [掘金专栏](https://juejin.im/user/5b5ff865f265da0f6b771700/posts)(每天同步更新)
|
||||
- [知乎专栏](https://zhuanlan.zhihu.com/fe-interview)(每天同步更新)
|
||||
- [Gitee](https://gitee.com/haizhilin/fe-interview)(每天同步更新)
|
||||
- [看云](https://www.kancloud.cn/aya001001/fe-interview)(每周同步更新)
|
||||
- 「前端剑解」 微信公众号(扫描下方二维码,每天同步更新)
|
||||
|
||||
## 转载说明
|
||||
> 近期,看到很多网络上的朋友滥用链接,包装了下就收费了,让有需要的朋友找不到最新的试题,违背了我的初衷,特添加了些声明:
|
||||
|
||||
- 声明
|
||||
1. 可以转载里面的所有面试题用到任何地方,但请添加仓库的地址,因为转载后你们很少会更新了,但此仓库每天都会准时更新。
|
||||
2. 此开源仓库从不收取任何费用,**现在不会,以后也不会**,也不会授权任何人/机构进行收费。
|
||||
3. 大家不需要对此仓库进行爬虫,如有需要什么格式的,可以私聊我,比如本地阅读的PDF,我有时间会做成PDF的,方便大家!
|
||||
|
||||
## License
|
||||
[](https://github.com/haizlin/fe-interview/blob/master/LICENSE)
|
302
other/算法与数据结构.md
302
other/算法与数据结构.md
@ -1,151 +1,151 @@
|
||||
# Algorithm
|
||||
leetcode/lintcode上的算法题
|
||||
|
||||
**关于问题的答案和解体的思路,可以移步 : https://github.com/zhaozhengcoder/Algorithm**
|
||||
|
||||
### About
|
||||
|
||||
这个仓库最初的想法是把lintcode/lintocde上面的算法题目整理一下,因为很多题目太多了显得太乱了,就不继续在GitHub上面写了,以前写的一部分移到我的博客上面了。
|
||||
GitHub上面打算整理一些比较典型 或者是 自己思考过的觉得很好的问题。
|
||||
|
||||
|
||||
在博客上面开了两个专栏
|
||||
|
||||
1. 数据结构/算法导论 :
|
||||
https://www.jianshu.com/nb/12397278
|
||||
|
||||
2. OJ练习题 :
|
||||
https://www.jianshu.com/nb/9973135
|
||||
|
||||
推荐两篇自己对 递归搜索和动态规划 的理解的blog :
|
||||
|
||||
1. https://www.jianshu.com/p/5eb4da919efe
|
||||
|
||||
2. https://www.jianshu.com/p/6b3a2304f63f
|
||||
|
||||
|
||||
|
||||
### 题目的索引
|
||||
GITHUB上面打算整理一些比较典型 或者是 自己思考过的觉得很好的问题。
|
||||
|
||||
1.从数据结构的角度索引 :
|
||||
|
||||
a. 数组
|
||||
|
||||
两数之和
|
||||
|
||||
连续最大子数组
|
||||
|
||||
乘积最大子数组
|
||||
|
||||
买卖股票的最佳时机1,2,3
|
||||
|
||||
买卖股票的最佳时机1:寻找数组里面的最大上升子序列
|
||||
买卖股票的最佳时机2:寻找数组里面所有的上升子序列
|
||||
买卖股票的最佳时机3:寻找数组里面两个不重合的上升子序列,并且使他们的和最大 to-do
|
||||
|
||||
区间合并(将有交集的区间合并)
|
||||
|
||||
寻找缺失的数
|
||||
|
||||
1. 一个顺序的数组[1,2,3,5,6],缺少了一个数字,如何找到它?
|
||||
|
||||
2. 一个arr的数组,只有一个数字出现了一次,其他都出现了两次,如何找到它?
|
||||
|
||||
数组的近似划分(将一个数组分成两个,但是差最小)
|
||||
|
||||
数组里面第k大的数
|
||||
|
||||
跳跃游戏1,2
|
||||
|
||||
跳跃游戏1:
|
||||
给出一个非负整数数组,你最初定位在数组的第一个位置,
|
||||
数组中的每个元素代表你在那个位置可以跳跃的最大长度,
|
||||
返回 是否能到达数组的最后一个位置
|
||||
|
||||
跳跃游戏2:
|
||||
给出一个非负整数数组,你最初定位在数组的第一个位置,
|
||||
数组中的每个元素代表你在那个位置可以跳跃的最大长度,
|
||||
返回 使用最少的跳跃次数到达数组的最后一个位置
|
||||
|
||||
a+. 二维矩阵
|
||||
|
||||
顺时针打印二维矩阵
|
||||
|
||||
给出一个二维矩阵,找到一个路径(从某个左上角到某个角右下)使这条路径的值最大
|
||||
|
||||
b. 链表
|
||||
|
||||
c. 字符串
|
||||
|
||||
最长公共子序列(并不是连续的)
|
||||
|
||||
最长回文子串
|
||||
|
||||
d. 二叉树
|
||||
|
||||
返回一个平衡二叉树的第k大的节点
|
||||
|
||||
二叉树的最低公共祖先
|
||||
|
||||
非递归遍历二叉树
|
||||
|
||||
e. 图
|
||||
|
||||
最短路径
|
||||
|
||||
深度/广度优先遍历
|
||||
|
||||
2. 从算法的角度建立索引 :
|
||||
|
||||
a. 递归搜索问题
|
||||
|
||||
N后问题
|
||||
|
||||
全排列
|
||||
|
||||
组合问题1,2
|
||||
|
||||
b. 动态规划
|
||||
|
||||
背包问题1,2
|
||||
|
||||
数组的近似划分(将一个数组分成两个,但是差最小)
|
||||
|
||||
跳跃游戏1,2
|
||||
|
||||
给出一个二维矩阵,找到一个路径(从某个左上角到某个角右下)使这条路径的值最大
|
||||
|
||||
|
||||
3. 常用
|
||||
|
||||
a. 排列/组合
|
||||
|
||||
b. 深度优先遍历
|
||||
|
||||
c. 最短路径
|
||||
|
||||
4. 智力题(算法本身很简单,就是想不到的那种)
|
||||
|
||||
最多有多少个点在同一条直线上
|
||||
|
||||
|
||||
### Others
|
||||
|
||||
1. 类似于系统设计的题目
|
||||
|
||||
带最小值的栈/队列
|
||||
|
||||
url长链接转短链接
|
||||
|
||||
2. 解决特定问题
|
||||
|
||||
并查集
|
||||
|
||||
布隆过滤器
|
||||
|
||||
|
||||
|
||||
如果你对机器学习的算法感兴趣,欢迎共同讨论:
|
||||
|
||||
https://github.com/zhaozhengcoder/Machine-Learning
|
||||
# Algorithm
|
||||
leetcode/lintcode上的算法题
|
||||
|
||||
**关于问题的答案和解体的思路,可以移步 : https://github.com/zhaozhengcoder/Algorithm**
|
||||
|
||||
### About
|
||||
|
||||
这个仓库最初的想法是把lintcode/lintocde上面的算法题目整理一下,因为很多题目太多了显得太乱了,就不继续在GitHub上面写了,以前写的一部分移到我的博客上面了。
|
||||
GitHub上面打算整理一些比较典型 或者是 自己思考过的觉得很好的问题。
|
||||
|
||||
|
||||
在博客上面开了两个专栏
|
||||
|
||||
1. 数据结构/算法导论 :
|
||||
https://www.jianshu.com/nb/12397278
|
||||
|
||||
2. OJ练习题 :
|
||||
https://www.jianshu.com/nb/9973135
|
||||
|
||||
推荐两篇自己对 递归搜索和动态规划 的理解的blog :
|
||||
|
||||
1. https://www.jianshu.com/p/5eb4da919efe
|
||||
|
||||
2. https://www.jianshu.com/p/6b3a2304f63f
|
||||
|
||||
|
||||
|
||||
### 题目的索引
|
||||
GITHUB上面打算整理一些比较典型 或者是 自己思考过的觉得很好的问题。
|
||||
|
||||
1.从数据结构的角度索引 :
|
||||
|
||||
a. 数组
|
||||
|
||||
两数之和
|
||||
|
||||
连续最大子数组
|
||||
|
||||
乘积最大子数组
|
||||
|
||||
买卖股票的最佳时机1,2,3
|
||||
|
||||
买卖股票的最佳时机1:寻找数组里面的最大上升子序列
|
||||
买卖股票的最佳时机2:寻找数组里面所有的上升子序列
|
||||
买卖股票的最佳时机3:寻找数组里面两个不重合的上升子序列,并且使他们的和最大 to-do
|
||||
|
||||
区间合并(将有交集的区间合并)
|
||||
|
||||
寻找缺失的数
|
||||
|
||||
1. 一个顺序的数组[1,2,3,5,6],缺少了一个数字,如何找到它?
|
||||
|
||||
2. 一个arr的数组,只有一个数字出现了一次,其他都出现了两次,如何找到它?
|
||||
|
||||
数组的近似划分(将一个数组分成两个,但是差最小)
|
||||
|
||||
数组里面第k大的数
|
||||
|
||||
跳跃游戏1,2
|
||||
|
||||
跳跃游戏1:
|
||||
给出一个非负整数数组,你最初定位在数组的第一个位置,
|
||||
数组中的每个元素代表你在那个位置可以跳跃的最大长度,
|
||||
返回 是否能到达数组的最后一个位置
|
||||
|
||||
跳跃游戏2:
|
||||
给出一个非负整数数组,你最初定位在数组的第一个位置,
|
||||
数组中的每个元素代表你在那个位置可以跳跃的最大长度,
|
||||
返回 使用最少的跳跃次数到达数组的最后一个位置
|
||||
|
||||
a+. 二维矩阵
|
||||
|
||||
顺时针打印二维矩阵
|
||||
|
||||
给出一个二维矩阵,找到一个路径(从某个左上角到某个角右下)使这条路径的值最大
|
||||
|
||||
b. 链表
|
||||
|
||||
c. 字符串
|
||||
|
||||
最长公共子序列(并不是连续的)
|
||||
|
||||
最长回文子串
|
||||
|
||||
d. 二叉树
|
||||
|
||||
返回一个平衡二叉树的第k大的节点
|
||||
|
||||
二叉树的最低公共祖先
|
||||
|
||||
非递归遍历二叉树
|
||||
|
||||
e. 图
|
||||
|
||||
最短路径
|
||||
|
||||
深度/广度优先遍历
|
||||
|
||||
2. 从算法的角度建立索引 :
|
||||
|
||||
a. 递归搜索问题
|
||||
|
||||
N后问题
|
||||
|
||||
全排列
|
||||
|
||||
组合问题1,2
|
||||
|
||||
b. 动态规划
|
||||
|
||||
背包问题1,2
|
||||
|
||||
数组的近似划分(将一个数组分成两个,但是差最小)
|
||||
|
||||
跳跃游戏1,2
|
||||
|
||||
给出一个二维矩阵,找到一个路径(从某个左上角到某个角右下)使这条路径的值最大
|
||||
|
||||
|
||||
3. 常用
|
||||
|
||||
a. 排列/组合
|
||||
|
||||
b. 深度优先遍历
|
||||
|
||||
c. 最短路径
|
||||
|
||||
4. 智力题(算法本身很简单,就是想不到的那种)
|
||||
|
||||
最多有多少个点在同一条直线上
|
||||
|
||||
|
||||
### Others
|
||||
|
||||
1. 类似于系统设计的题目
|
||||
|
||||
带最小值的栈/队列
|
||||
|
||||
url长链接转短链接
|
||||
|
||||
2. 解决特定问题
|
||||
|
||||
并查集
|
||||
|
||||
布隆过滤器
|
||||
|
||||
|
||||
|
||||
如果你对机器学习的算法感兴趣,欢迎共同讨论:
|
||||
|
||||
https://github.com/zhaozhengcoder/Machine-Learning
|
||||
|
Loading…
x
Reference in New Issue
Block a user