mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-14 07:51:30 +08:00
Merge branch 'master' of https://github.com/CyC2018/Interview-Notebook
This commit is contained in:
150
README.md
150
README.md
@ -6,164 +6,164 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="other/LogoMakr_0zpEzN.png" width="150px">
|
<img src="other/LogoMakr_0zpEzN.png" width="150px">
|
||||||
<br>
|
<br>
|
||||||
<a href="other/Group.md"> <img src="https://img.shields.io/badge/>-qq-4ab8a1.svg"></a> <a href="https://legacy.gitbook.com/book/cyc2018/interview-notebook/details"> <img src="https://img.shields.io/badge/_-gitbook-4ab8a1.svg"></a>
|
<a href="other/Group.md"> <img src="https://img.shields.io/badge/>-group-4ab8a1.svg"></a> <a href="https://legacy.gitbook.com/book/cyc2018/interview-notebook/details"> <img src="https://img.shields.io/badge/_-gitbook-4ab8a1.svg"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- [](https://gitter.im/CyC2018-Interview-Notebook/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) [](https://legacy.gitbook.com/book/cyc2018/interview-notebook/details) -->
|
<!-- [](https://gitter.im/CyC2018-Interview-Notebook/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) [](https://legacy.gitbook.com/book/cyc2018/interview-notebook/details) -->
|
||||||
|
|
||||||
## 算法 :pencil2:
|
## 算法 :pencil2:
|
||||||
|
|
||||||
> [剑指 Offer 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/剑指%20offer%20题解.md)
|
- [剑指 Offer 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/剑指%20offer%20题解.md)
|
||||||
|
|
||||||
目录根据原书第二版进行编排,代码和原书有所不同,尽量比原书更简洁。
|
目录根据原书第二版进行编排,代码和原书有所不同,尽量比原书更简洁。
|
||||||
|
|
||||||
> [Leetcode 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Leetcode%20题解.md)
|
- [Leetcode 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Leetcode%20题解.md)
|
||||||
|
|
||||||
对题目做了一个大致分类,并对每种题型的解题思路做了总结。
|
对题目做了一个大致分类,并对每种题型的解题思路做了总结。
|
||||||
|
|
||||||
> [算法](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/算法.md)
|
- [算法](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/算法.md)
|
||||||
|
|
||||||
排序、并查集、栈和队列、红黑树、散列表。
|
排序、并查集、栈和队列、红黑树、散列表。
|
||||||
|
|
||||||
## 操作系统 :computer:
|
## 操作系统 :computer:
|
||||||
|
|
||||||
> [计算机操作系统](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/计算机操作系统.md)
|
- [计算机操作系统](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/计算机操作系统.md)
|
||||||
|
|
||||||
进程管理、内存管理、设备管理、链接。
|
进程管理、内存管理、设备管理、链接。
|
||||||
|
|
||||||
> [Linux](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Linux.md)
|
- [Linux](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Linux.md)
|
||||||
|
|
||||||
基本实现原理以及基本操作。
|
基本实现原理以及基本操作。
|
||||||
|
|
||||||
## 网络 :cloud:
|
## 网络 :cloud:
|
||||||
|
|
||||||
> [计算机网络](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/计算机网络.md)
|
- [计算机网络](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/计算机网络.md)
|
||||||
|
|
||||||
物理层、链路层、网络层、运输层、应用层。
|
物理层、链路层、网络层、运输层、应用层。
|
||||||
|
|
||||||
> [HTTP](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/HTTP.md)
|
- [HTTP](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/HTTP.md)
|
||||||
|
|
||||||
方法、状态码、Cookie、缓存、连接管理、HTTPs、HTTP 2.0。
|
方法、状态码、Cookie、缓存、连接管理、HTTPs、HTTP 2.0。
|
||||||
|
|
||||||
> [Socket](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Socket.md)
|
- [Socket](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Socket.md)
|
||||||
|
|
||||||
I/O 模型、I/O 多路复用。
|
I/O 模型、I/O 多路复用。
|
||||||
|
|
||||||
## 面向对象 :couple:
|
## 面向对象 :couple:
|
||||||
|
|
||||||
> [设计模式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/设计模式.md)
|
- [设计模式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/设计模式.md)
|
||||||
|
|
||||||
实现了 Gof 的 23 种设计模式。
|
实现了 Gof 的 23 种设计模式。
|
||||||
|
|
||||||
> [面向对象思想](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/面向对象思想.md)
|
- [面向对象思想](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/面向对象思想.md)
|
||||||
|
|
||||||
三大原则(继承、封装、多态)、类图、设计原则。
|
三大原则(继承、封装、多态)、类图、设计原则。
|
||||||
|
|
||||||
## 数据库 :floppy_disk:
|
## 数据库 :floppy_disk:
|
||||||
|
|
||||||
> [数据库系统原理](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/数据库系统原理.md)
|
- [数据库系统原理](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/数据库系统原理.md)
|
||||||
|
|
||||||
事务、锁、隔离级别、MVCC、间隙锁、范式。
|
事务、锁、隔离级别、MVCC、间隙锁、范式。
|
||||||
|
|
||||||
> [SQL](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/SQL.md)
|
- [SQL](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/SQL.md)
|
||||||
|
|
||||||
SQL 基本语法。
|
SQL 基本语法。
|
||||||
|
|
||||||
> [Leetcode-Database 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Leetcode-Database%20题解.md)
|
- [Leetcode-Database 题解](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Leetcode-Database%20题解.md)
|
||||||
|
|
||||||
Leetcode 上数据库题目的解题记录。
|
Leetcode 上数据库题目的解题记录。
|
||||||
|
|
||||||
> [MySQL](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/MySQL.md)
|
- [MySQL](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/MySQL.md)
|
||||||
|
|
||||||
存储引擎、索引、查询优化、切分、复制。
|
存储引擎、索引、查询优化、切分、复制。
|
||||||
|
|
||||||
> [Redis](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Redis.md)
|
- [Redis](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Redis.md)
|
||||||
|
|
||||||
五种数据类型、字典和跳跃表数据结构、使用场景、和 Memcache 的比较、淘汰策略、持久化、文件事件的 Reactor 模式、复制。
|
五种数据类型、字典和跳跃表数据结构、使用场景、和 Memcache 的比较、淘汰策略、持久化、文件事件的 Reactor 模式、复制。
|
||||||
|
|
||||||
## Java :coffee:
|
## Java :coffee:
|
||||||
|
|
||||||
> [Java 基础](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20基础.md)
|
- [Java 基础](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20基础.md)
|
||||||
|
|
||||||
不会涉及很多基本语法介绍,主要是一些实现原理以及关键特性。
|
不会涉及很多基本语法介绍,主要是一些实现原理以及关键特性。
|
||||||
|
|
||||||
> [Java 容器](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20容器.md)
|
- [Java 容器](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20容器.md)
|
||||||
|
|
||||||
源码分析:ArrayList、Vector、CopyOnWriteArrayList、LinkedList、HashMap、ConcurrentHashMap、LinkedHashMap、WeekHashMap。
|
源码分析:ArrayList、Vector、CopyOnWriteArrayList、LinkedList、HashMap、ConcurrentHashMap、LinkedHashMap、WeekHashMap。
|
||||||
|
|
||||||
> [Java 并发](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20并发.md)
|
- [Java 并发](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20并发.md)
|
||||||
|
|
||||||
线程使用方式、两种互斥同步方法、线程协作、JUC、线程安全、内存模型、锁优化。
|
线程使用方式、两种互斥同步方法、线程协作、JUC、线程安全、内存模型、锁优化。
|
||||||
|
|
||||||
> [Java 虚拟机](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20虚拟机.md)
|
- [Java 虚拟机](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20虚拟机.md)
|
||||||
|
|
||||||
运行时数据区域、垃圾收集、类加载。
|
运行时数据区域、垃圾收集、类加载。
|
||||||
|
|
||||||
> [Java I/O](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20IO.md)
|
- [Java I/O](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Java%20IO.md)
|
||||||
|
|
||||||
NIO 的原理以及实例。
|
NIO 的原理以及实例。
|
||||||
|
|
||||||
## 系统设计 :bulb:
|
## 系统设计 :bulb:
|
||||||
|
|
||||||
> [系统设计基础](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/系统设计基础.md)
|
- [系统设计基础](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/系统设计基础.md)
|
||||||
|
|
||||||
性能、伸缩性、扩展性、可用性、安全性
|
性能、伸缩性、扩展性、可用性、安全性
|
||||||
|
|
||||||
> [分布式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/分布式.md)
|
- [分布式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/分布式.md)
|
||||||
|
|
||||||
分布式锁、分布式事务、CAP、BASE、Paxos、Raft
|
分布式锁、分布式事务、CAP、BASE、Paxos、Raft
|
||||||
|
|
||||||
> [集群](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/集群.md)
|
- [集群](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/集群.md)
|
||||||
|
|
||||||
负载均衡、Session 管理
|
负载均衡、Session 管理
|
||||||
|
|
||||||
> [攻击技术](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/攻击技术.md)
|
- [攻击技术](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/攻击技术.md)
|
||||||
|
|
||||||
XSS、CSRF、SQL 注入、DDoS
|
XSS、CSRF、SQL 注入、DDoS
|
||||||
|
|
||||||
> [缓存](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/缓存.md)
|
- [缓存](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/缓存.md)
|
||||||
|
|
||||||
缓存特征、缓存位置、缓存问题、数据分布、一致性哈希、LRU、CDN
|
缓存特征、缓存位置、缓存问题、数据分布、一致性哈希、LRU、CDN
|
||||||
|
|
||||||
> [消息队列](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/消息队列.md)
|
- [消息队列](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/消息队列.md)
|
||||||
|
|
||||||
消息处理模型、使用场景、可靠性
|
消息处理模型、使用场景、可靠性
|
||||||
|
|
||||||
## 工具 :hammer:
|
## 工具 :hammer:
|
||||||
|
|
||||||
> [Git](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Git.md)
|
- [Git](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Git.md)
|
||||||
|
|
||||||
一些 Git 的使用和概念。
|
一些 Git 的使用和概念。
|
||||||
|
|
||||||
> [Docker](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Docker.md)
|
- [Docker](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/Docker.md)
|
||||||
|
|
||||||
Docker 基本原理。
|
Docker 基本原理。
|
||||||
|
|
||||||
> [正则表达式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/正则表达式.md)
|
- [正则表达式](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/正则表达式.md)
|
||||||
|
|
||||||
正则表达式基本语法。
|
正则表达式基本语法。
|
||||||
|
|
||||||
> [构建工具](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/构建工具.md)
|
- [构建工具](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/构建工具.md)
|
||||||
|
|
||||||
构建工具的基本概念、主流构建工具介绍。
|
构建工具的基本概念、主流构建工具介绍。
|
||||||
|
|
||||||
## 编码实践 :speak_no_evil:
|
## 编码实践 :speak_no_evil:
|
||||||
|
|
||||||
> [重构](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/重构.md)
|
- [重构](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/重构.md)
|
||||||
|
|
||||||
参考 重构 改善既有代码的设计。
|
参考 重构 改善既有代码的设计。
|
||||||
|
|
||||||
> [代码可读性](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/代码可读性.md)
|
- [代码可读性](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/代码可读性.md)
|
||||||
|
|
||||||
参考 编写可读代码的艺术。
|
参考 编写可读代码的艺术。
|
||||||
|
|
||||||
> [代码风格规范](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/代码风格规范.md)
|
- [代码风格规范](https://github.com/CyC2018/InnterviewNotes/blob/master/notes/代码风格规范.md)
|
||||||
|
|
||||||
Google 开源项目的代码风格规范。
|
Google 开源项目的代码风格规范。
|
||||||
|
|
||||||
## 后记 :memo:
|
## 后记 :memo:
|
||||||
|
|
||||||
**About**
|
### About
|
||||||
|
|
||||||
这个仓库是笔者的一个学习笔记,主要总结一些比较重要的知识点,希望对大家有所帮助。
|
这个仓库是笔者的一个学习笔记,主要总结一些比较重要的知识点,希望对大家有所帮助。
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ Google 开源项目的代码风格规范。
|
|||||||
|
|
||||||
[BOOKLIST](https://github.com/CyC2018/Interview-Notebook/blob/master/BOOKLIST.md),这个书单是笔者至今看的一些比较好的技术书籍,虽然没有全都看完,但每本书多多少少都看了一部分。
|
[BOOKLIST](https://github.com/CyC2018/Interview-Notebook/blob/master/BOOKLIST.md),这个书单是笔者至今看的一些比较好的技术书籍,虽然没有全都看完,但每本书多多少少都看了一部分。
|
||||||
|
|
||||||
**How To Contribute**
|
### How To Contribute
|
||||||
|
|
||||||
笔记内容是笔者一个字一个字打上去的,难免会有一些笔误,如果发现笔误可直接在相应文档进行编辑修改。
|
笔记内容是笔者一个字一个字打上去的,难免会有一些笔误,如果发现笔误可直接在相应文档进行编辑修改。
|
||||||
|
|
||||||
@ -179,13 +179,13 @@ Google 开源项目的代码风格规范。
|
|||||||
|
|
||||||
欢迎在 Issue 中提交对本仓库的改进建议~
|
欢迎在 Issue 中提交对本仓库的改进建议~
|
||||||
|
|
||||||
**Authorization**
|
### Authorization
|
||||||
|
|
||||||
虽然没有加开源协议,但是允许非商业性使用。
|
虽然没有加开源协议,但是允许非商业性使用。
|
||||||
|
|
||||||
转载使用请注明出处,谢谢!
|
转载使用请注明出处,谢谢!
|
||||||
|
|
||||||
**Typesetting**
|
### Typesetting
|
||||||
|
|
||||||
笔记内容按照 [中文文案排版指北](http://mazhuang.org/wiki/chinese-copywriting-guidelines/) 进行排版,以保证内容的可读性。
|
笔记内容按照 [中文文案排版指北](http://mazhuang.org/wiki/chinese-copywriting-guidelines/) 进行排版,以保证内容的可读性。
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ Google 开源项目的代码风格规范。
|
|||||||
|
|
||||||
笔者将自己实现的文档排版功能提取出来,放在 Github Page 中,无需下载安装即可免费使用:[Text-Typesetting](https://github.com/CyC2018/Markdown-Typesetting)。
|
笔者将自己实现的文档排版功能提取出来,放在 Github Page 中,无需下载安装即可免费使用:[Text-Typesetting](https://github.com/CyC2018/Markdown-Typesetting)。
|
||||||
|
|
||||||
**Uploading**
|
### Uploading
|
||||||
|
|
||||||
笔者在本地使用为知笔记软件进行书写,为了方便将本地笔记内容上传到 Github 上,实现了一整套自动化上传方案,包括文本文件的导出、提取图片、Markdown 文档转换、Git 同步。
|
笔者在本地使用为知笔记软件进行书写,为了方便将本地笔记内容上传到 Github 上,实现了一整套自动化上传方案,包括文本文件的导出、提取图片、Markdown 文档转换、Git 同步。
|
||||||
|
|
||||||
@ -201,15 +201,15 @@ Google 开源项目的代码风格规范。
|
|||||||
|
|
||||||
笔者将自己实现文档转换功能提取出来,方便大家在需要将本地 Markdown 上传到 Github,或者制作项目 README 文档时生成目录时使用:[GFM-Converter](https://github.com/CyC2018/GFM-Converter)。
|
笔者将自己实现文档转换功能提取出来,方便大家在需要将本地 Markdown 上传到 Github,或者制作项目 README 文档时生成目录时使用:[GFM-Converter](https://github.com/CyC2018/GFM-Converter)。
|
||||||
|
|
||||||
**Statement**
|
### Statement
|
||||||
|
|
||||||
本仓库不参与商业行为,不向读者收取任何费用。(This repository is not engaging in business activities, and does not charge readers any fee.)
|
本仓库不参与商业行为,不向读者收取任何费用。(This repository is not engaging in business activities, and does not charge readers any fee.)
|
||||||
|
|
||||||
**Logo**
|
### Logo
|
||||||
|
|
||||||
Power by [logomakr](https://logomakr.com/).
|
Power by [logomakr](https://logomakr.com/).
|
||||||
|
|
||||||
**Acknowledgements**
|
### Acknowledgements
|
||||||
|
|
||||||
感谢以下人员对本仓库做出的贡献,当然不仅仅只有这些贡献者,这里就不一一列举了。如果你希望被添加到这个名单中,并且提交过 Issue 或者 PR,请与笔者联系。
|
感谢以下人员对本仓库做出的贡献,当然不仅仅只有这些贡献者,这里就不一一列举了。如果你希望被添加到这个名单中,并且提交过 Issue 或者 PR,请与笔者联系。
|
||||||
|
|
||||||
|
@ -57,9 +57,15 @@
|
|||||||
|
|
||||||
## 双指针
|
## 双指针
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
双指针主要用于遍历数组,两个指针指向不同的元素,从而协同完成任务。
|
双指针主要用于遍历数组,两个指针指向不同的元素,从而协同完成任务。
|
||||||
|
|
||||||
**有序数组的 Two Sum**
|
**有序数组的 Two Sum**
|
||||||
|
=======
|
||||||
|
保证每次操作都是局部最优的,并且最后得到的结果是全局最优的。
|
||||||
|
|
||||||
|
**分配饼干**
|
||||||
|
>>>>>>> b6156c4247f05d29a65564f0e337545fde70fea1
|
||||||
|
|
||||||
[Leetcode :167. Two Sum II - Input array is sorted (Easy)](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/)
|
[Leetcode :167. Two Sum II - Input array is sorted (Easy)](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/)
|
||||||
|
|
||||||
@ -70,7 +76,11 @@ Output: index1=1, index2=2
|
|||||||
|
|
||||||
题目描述:在有序数组中找出两个数,使它们的和为 target。
|
题目描述:在有序数组中找出两个数,使它们的和为 target。
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
使用双指针,一个指针指向值较小的元素,一个指针指向值较大的元素。指向较小元素的指针从头向尾遍历,指向较大元素的指针从尾向头遍历。
|
使用双指针,一个指针指向值较小的元素,一个指针指向值较大的元素。指向较小元素的指针从头向尾遍历,指向较大元素的指针从尾向头遍历。
|
||||||
|
=======
|
||||||
|
给一个孩子的饼干应当尽量小又能满足该孩子,这样大饼干就能拿来给满足度比较大的孩子。因为最小的孩子最容易得到满足,所以先满足最小的孩子。
|
||||||
|
>>>>>>> b6156c4247f05d29a65564f0e337545fde70fea1
|
||||||
|
|
||||||
- 如果两个指针指向元素的和 sum == target,那么得到要求的结果;
|
- 如果两个指针指向元素的和 sum == target,那么得到要求的结果;
|
||||||
- 如果 sum > target,移动较大的元素,使 sum 变小一些;
|
- 如果 sum > target,移动较大的元素,使 sum 变小一些;
|
||||||
|
Reference in New Issue
Block a user