This commit is contained in:
CyC2018
2020-05-27 00:38:10 +08:00
28 changed files with 1324 additions and 1153 deletions

View File

@ -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> -->

View File

@ -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">-->
[![stars](https://badgen.net/github/stars/CyC2018/CS-Notes?icon=github&color=4ab8a1)](https://github.com/CyC2018/CS-Notes) [![forks](https://badgen.net/github/forks/CyC2018/CS-Notes?icon=github&color=4ab8a1)](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">-->
[![stars](https://badgen.net/github/stars/CyC2018/CS-Notes?icon=github&color=4ab8a1)](https://github.com/CyC2018/CS-Notes) [![forks](https://badgen.net/github/forks/CyC2018/CS-Notes?icon=github&color=4ab8a1)](https://github.com/CyC2018/CS-Notes)
[开始阅读](README.md)

View File

@ -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>

View File

@ -521,7 +521,7 @@ public static final int value = 123;
其中解析过程在某些情况下可以在初始化阶段之后再开始这是为了支持 Java 的动态绑定
<div data="补充为什么可以支持动态绑定 --> <--"></div>
### 5. 初始化
### 5. 初始化
<div data="modify -->"></div>
初始化阶段才真正开始执行类中定义的 Java 程序代码初始化阶段是虚拟机执行类构造器 &lt;clinit>() 方法的过程在准备阶段类变量已经赋过一次系统要求的初始值而在初始化阶段根据程序员通过程序制定的主观计划去初始化类变量和其它资源

View File

@ -1,4 +1,5 @@
<!-- GFM-TOC -->
* [0. 原理](#0-原理)
* [1. 统计两个数的二进制表示有多少位不同](#1-统计两个数的二进制表示有多少位不同)
* [2. 数组中唯一一个不重复的元素](#2-数组中唯一一个不重复的元素)
* [3. 找出数组中缺失的那个数](#3-找出数组中缺失的那个数)
@ -15,7 +16,9 @@
<!-- GFM-TOC -->
**基本原理**
# 0. 原理
**基本原理**
0s 表示一串 01s 表示一串 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 mask00111100 进行位与操作只保留 num 中与 mask 1 部分相对应的位
- 利用 x | 0s = x x | 1s = 1s 的特点可以实现设值操作一个数 num mask00111100 进行位或操作 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 mask00111100 进行位与操作只保留 num 中与 mask 1 部分相对应的位
移位运算
```
01011011 &
00111100
--------
00011000
```
- \>\> n 为算术右移相当于除以 2<sup>n</sup>
- \>\>\> n 为无符号右移左边会补上 0
- &lt;&lt; n 为算术左移相当于乘以 2<sup>n</sup>
利用 x | 0s = x x | 1s = 1s 的特点可以实现设值操作一个数 num mask00111100 进行位或操作 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
```
&lt;&lt; n 为算术左移相当于乘以 2<sup>n</sup>-7 << 2 = -28
```
11111111111111111111111111111001 << 2
--------
11111111111111111111111111100100
```
**mask 计算**
要获取 111111111 0 取反即可\~0

View File

@ -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. 组成整数的最小平方数数量

View File

@ -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 |
连接情况如下

View File

@ -1021,7 +1021,7 @@ g/re/pglobally 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

View File

@ -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.

View File

@ -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=0M=1而不是被频繁使用的干净页面R=1M=0
## 4. 先进先出
## 4. 先进先出
> FIFO, First In First Out