This commit is contained in:
CyC2018
2018-08-10 21:59:39 +08:00
2 changed files with 85 additions and 75 deletions

150
README.md
View File

@ -6,164 +6,164 @@
<div align="center">
<img src="other/LogoMakr_0zpEzN.png" width="150px">
<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>
<!-- [![](https://img.shields.io/badge/>-gitter-blue.svg)](https://gitter.im/CyC2018-Interview-Notebook/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link) [![](https://img.shields.io/badge/_-gitbook-4ab8a1.svg)](https://legacy.gitbook.com/book/cyc2018/interview-notebook/details) -->
## 算法 :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:
> [计算机操作系统](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:
> [计算机网络](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:
> [设计模式](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:
> [数据库系统原理](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 基础](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:
> [系统设计基础](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:
> [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:
> [重构](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:
**About**
### About
这个仓库是笔者的一个学习笔记,主要总结一些比较重要的知识点,希望对大家有所帮助。
@ -171,7 +171,7 @@ Google 开源项目的代码风格规范。
[BOOKLIST](https://github.com/CyC2018/Interview-Notebook/blob/master/BOOKLIST.md),这个书单是笔者至今看的一些比较好的技术书籍,虽然没有全都看完,但每本书多多少少都看了一部分。
**How To Contribute**
### How To Contribute
笔记内容是笔者一个字一个字打上去的,难免会有一些笔误,如果发现笔误可直接在相应文档进行编辑修改。
@ -179,13 +179,13 @@ Google 开源项目的代码风格规范。
欢迎在 Issue 中提交对本仓库的改进建议~
**Authorization**
### Authorization
虽然没有加开源协议,但是允许非商业性使用。
转载使用请注明出处,谢谢!
**Typesetting**
### Typesetting
笔记内容按照 [中文文案排版指北](http://mazhuang.org/wiki/chinese-copywriting-guidelines/) 进行排版,以保证内容的可读性。
@ -193,7 +193,7 @@ Google 开源项目的代码风格规范。
笔者将自己实现的文档排版功能提取出来,放在 Github Page 中,无需下载安装即可免费使用:[Text-Typesetting](https://github.com/CyC2018/Markdown-Typesetting)。
**Uploading**
### Uploading
笔者在本地使用为知笔记软件进行书写,为了方便将本地笔记内容上传到 Github 上实现了一整套自动化上传方案包括文本文件的导出、提取图片、Markdown 文档转换、Git 同步。
@ -201,15 +201,15 @@ Google 开源项目的代码风格规范。
笔者将自己实现文档转换功能提取出来,方便大家在需要将本地 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.)
**Logo**
### Logo
Power by [logomakr](https://logomakr.com/).
**Acknowledgements**
### Acknowledgements
感谢以下人员对本仓库做出的贡献,当然不仅仅只有这些贡献者,这里就不一一列举了。如果你希望被添加到这个名单中,并且提交过 Issue 或者 PR请与笔者联系。

View File

@ -57,9 +57,15 @@
## 双指针
<<<<<<< HEAD
双指针主要用于遍历数组两个指针指向不同的元素从而协同完成任务
**有序数组的 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/)
@ -70,7 +76,11 @@ Output: index1=1, index2=2
题目描述:在有序数组中找出两个数,使它们的和为 target。
<<<<<<< HEAD
使用双指针一个指针指向值较小的元素一个指针指向值较大的元素指向较小元素的指针从头向尾遍历指向较大元素的指针从尾向头遍历
=======
给一个孩子的饼干应当尽量小又能满足该孩子这样大饼干就能拿来给满足度比较大的孩子因为最小的孩子最容易得到满足所以先满足最小的孩子
>>>>>>> b6156c4247f05d29a65564f0e337545fde70fea1
- 如果两个指针指向元素的和 sum == target那么得到要求的结果
- 如果 sum > target移动较大的元素使 sum 变小一些;