Update LICENSE

This commit is contained in:
krahets
2023-10-10 19:50:04 +08:00
parent 04658dd333
commit 406decbc81
3 changed files with 70 additions and 147 deletions

View File

@@ -1,4 +1,4 @@
Attribution-ShareAlike 4.0 International
Attribution-NonCommercial-ShareAlike 4.0 International
=======================================================================
@@ -33,7 +33,7 @@ exhaustive, and do not form part of our licenses.
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
@@ -48,24 +48,24 @@ exhaustive, and do not form part of our licenses.
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Attribution-NonCommercial-ShareAlike 4.0 International Public License
("Public License"). To the extent this Public License may be
interpreted as a contract, You are granted the Licensed Rights in
consideration of Your acceptance of these terms and conditions, and the
Licensor grants You such rights in consideration of benefits the
Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 -- Definitions.
@@ -84,7 +84,7 @@ Section 1 -- Definitions.
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
c. BY-NC-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
@@ -108,7 +108,7 @@ Section 1 -- Definitions.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
Public License are Attribution, NonCommercial, and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
@@ -122,7 +122,15 @@ Section 1 -- Definitions.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
k. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
l. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
@@ -130,13 +138,13 @@ Section 1 -- Definitions.
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
m. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
n. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
@@ -150,9 +158,10 @@ Section 2 -- Scope.
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
in part, for NonCommercial purposes only; and
b. produce, reproduce, and Share Adapted Material.
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
@@ -220,7 +229,9 @@ Section 2 -- Scope.
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
@@ -265,7 +276,6 @@ following conditions.
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
@@ -277,7 +287,7 @@ following conditions.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
later, or a BY-NC-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
@@ -297,14 +307,15 @@ apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
@@ -404,7 +415,6 @@ Section 8 -- Interpretation.
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public

21
LICENSE-SAMPLECODE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Krahets
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

134
README.md
View File

@@ -13,13 +13,15 @@
[《图解算法数据结构》](https://leetcode-cn.com/leetbook/detail/illustration-of-algorithm/)是一本面向算法初学者和互联网求职者编写的 LeetBook 手册。
- 图文并茂地讲解《剑指 Offer》75 道题目,题库活跃于各大互联网公司笔面试
- 重点解析部分算法知识,包括复杂度分析、数据结构、排序算法和动态规划等
- 提供简洁的 Python, Java, C++ 解题代码和一个月刷题计划,让刷题有迹可循
- 图文详解 75 道题目,覆盖主要算法知识点,非常适合作为算法学习的第一份题库
- 题目活跃于各大互联网公司招聘中,可使笔面试准备事半功倍
- 致力于行文深入浅出、图文搭配,提供简洁的 Python, Java, C++ 解题代码。
> 若本 LeetBook 对您有所帮助,请在页面右上角点个 Star :star: 支持一下,谢谢!
---
## 如何入门算法?
### 第一步:看入门书
<p align="center">
<img src="https://www.hello-algo.com/index.assets/conceptual_rendering.png" width="175">
@@ -27,7 +29,7 @@
</p>
<p align="center">
推荐算法初学者阅读《Hello 算法》,夯实基础后可大幅提升刷题效率
《Hello 算法》:动画图解、一键运行的数据结构与算法教程
</p>
<p align="center">
@@ -40,123 +42,13 @@
</a>
</p>
---
### 第二步:刷算法题
本《剑指 Offer》刷题计划已被[力扣LeetCode官方题单](https://leetcode.cn/study-plan/lcof/)采用
行百里者半九十,坚持一个月刷完,一起加油!
| 日程 | 题目 |
| :--------: | :------------------------------------------------ |
| **Day 1** | **栈与队列(简单)** |
| | [剑指 Offer 09. 用两个栈实现队列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5d3i87/) |
| | [剑指 Offer 30. 包含 min 函数的栈](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/50bp33/) |
| **Day 2** | **链表(简单)** |
| | [剑指 Offer 06. 从尾到头打印链表](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dt66m/) |
| | [剑指 Offer 24. 反转链表](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9pdjbm/) |
| | [剑指 Offer 35. 复杂链表的复制](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9p0yy1/) |
| **Day 3** | **字符串(简单)** |
| | [剑指 Offer 05. 替换空格](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/50ywkd/) |
| | [剑指 Offer 58 - II. 左旋转字符串](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/589fz2/) |
| **Day 4** | **查找算法(简单)** |
| | [剑指 Offer 03. 数组中重复的数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/59bjss/) |
| | [剑指 Offer 53 - I. 在排序数组中查找数字 I](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5874p1/) |
| | [剑指 Offer 53 - II. 0n-1 中缺失的数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58iqo5/) |
| **Day 5** | **查找算法(中等)** |
| | [剑指 Offer 04. 二维数组中的查找](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5v76yi/) |
| | [剑指 Offer 11. 旋转数组的最小数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/50xofm/) |
| | [剑指 Offer 50. 第一个只出现一次的字符](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5viisg/) |
| **Day 6** | **搜索与回溯算法(简单)** |
| | [剑指 Offer 32 - I. 从上到下打印二叉树](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9ackoe/) |
| | [剑指 Offer 32 - II. 从上到下打印二叉树 II](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vawr3/) |
| | [剑指 Offer 32 - III. 从上到下打印二叉树 III](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vnp91/) |
| **Day 7** | **搜索与回溯算法(简单)** |
| | [剑指 Offer 26. 树的子结构](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dshwe/) |
| | [剑指 Offer 27. 二叉树的镜像](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/59zt5i/) |
| | [剑指 Offer 28. 对称的二叉树](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5d412v/) |
| **Day 8** | **动态规划(简单)** |
| | [剑指 Offer 10- I. 斐波那契数列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/50fxu1/) |
| | [剑指 Offer 10- II. 青蛙跳台阶问题](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57hyl5/) |
| | [剑指 Offer 63. 股票的最大利润](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58nn7r/) |
| **Day 9** | **动态规划(中等)** |
| | [剑指 Offer 42. 连续子数组的最大和](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/59gq9c/) |
| | [剑指 Offer 47. 礼物的最大价值](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vokvr/) |
| **Day 10** | **动态规划(中等)** |
| | [剑指 Offer 46. 把数字翻译成字符串](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/99wd55/) |
| | [剑指 Offer 48. 最长不含重复字符的子字符串](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dgr0c/) |
| **Day 11** | **双指针(简单)** |
| | [剑指 Offer 18. 删除链表的节点](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/505fc7/) |
| | [剑指 Offer 22. 链表中倒数第 k 个节点](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58tl52/) |
| **Day 12** | **双指针(简单)** |
| | [剑指 Offer 25. 合并两个排序的链表](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vq98s/) |
| | [剑指 Offer 52. 两个链表的第一个公共节点](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/oe5os3/) |
| **Day 13** | **双指针(简单)** |
| | [剑指 Offer 21. 调整数组顺序使奇数位于偶数前面](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5v8a6t/) |
| | [剑指 Offer 57. 和为 s 的两个数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5832fi/) |
| | [剑指 Offer 58 - I. 翻转单词顺序](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/586ecg/) |
| **Day 14** | **搜索与回溯算法(中等)** |
| | [剑指 Offer 12. 矩阵中的路径](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58wowd/) |
| | [剑指 Offer 13. 机器人的运动范围](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9h6vo2/) |
| **Day 15** | **搜索与回溯算法(中等)** |
| | [剑指 Offer 34. 二叉树中和为某一值的路径](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dy6pt/) |
| | [剑指 Offer 36. 二叉搜索树与双向链表](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dbies/) |
| | [剑指 Offer 54. 二叉搜索树的第 k 大节点](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58df23/) |
| **Day 16** | **排序(简单)** |
| | [剑指 Offer 45. 把数组排成最小的数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/59ypcj/) |
| | [剑指 Offer 61. 扑克牌中的顺子](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57mpoj/) |
| **Day 17** | **排序(中等)** |
| | [剑指 Offer 40. 最小的 k 个数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/ohvl0d/) |
| | [剑指 Offer 41. 数据流中的中位数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vd1j2/) |
| **Day 18** | **搜索与回溯算法(中等)** |
| | [剑指 Offer 55 - I. 二叉树的深度](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9hgr5i/) |
| | [剑指 Offer 55 - II. 平衡二叉树](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9hzffg/) |
| **Day 19** | **搜索与回溯算法(中等)** |
| | [剑指 Offer 64. 求 1 + 2 + … + n](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9h44cj/) |
| | [剑指 Offer 68 - I. 二叉搜索树的最近公共祖先](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/575kd2/) |
| | [剑指 Offer 68 - II. 二叉树的最近公共祖先](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57euni/) |
| **Day 20** | **分治算法(中等)** |
| | [剑指 Offer 07. 重建二叉树](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/99lxci/) |
| | [剑指 Offer 16. 数值的整数次方](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57rwmg/) |
| | [剑指 Offer 33. 二叉搜索树的后序遍历序列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vwxx5/) |
| **Day 21** | **位运算(简单)** |
| | [剑指 Offer 15. 二进制中 1 的个数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vk1l3/) |
| | [剑指 Offer 65. 不用加减乘除做加法](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vz6d1/) |
| **Day 22** | **位运算(中等)** |
| | [剑指 Offer 56 - I. 数组中数字出现的次数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/eubbnm/) |
| | [剑指 Offer 56 - II. 数组中数字出现的次数 II](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9hyq1r/) |
| **Day 23** | **数学(简单)** |
| | [剑指 Offer 39. 数组中出现次数超过一半的数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/99iy4g/) |
| | [剑指 Offer 66. 构建乘积数组](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57d8cm/) |
| **Day 24** | **数学(中等)** |
| | [剑指 Offer 14- I. 剪绳子](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5v1026/) |
| | [剑指 Offer 57 - II. 和为 s 的连续正数序列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/eufzm7/) |
| | [剑指 Offer 62. 圆圈中最后剩下的数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/oxrkot/) |
| **Day 25** | **模拟(中等)** |
| | [剑指 Offer 29. 顺时针打印矩阵](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vfh9g/) |
| | [剑指 Offer 31. 栈的压入、弹出序列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5wh1hj/) |
| **Day 26** | **字符串(中等)** |
| | [剑指 Offer 20. 表示数值的字符串](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5d6vi6/) |
| | [剑指 Offer 67. 把字符串转换成整数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58pq8g/) |
| **Day 27** | **栈与队列(困难)** |
| | [剑指 Offer 59 - I. 滑动窗口的最大值](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/58o46i/) |
| | [剑指 Offer 59 - II. 队列的最大值](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/e2t5ug/) |
| **Day 28** | **搜索与回溯算法(困难)** |
| | [剑指 Offer 37. 序列化二叉树](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/990pf2/) |
| | [剑指 Offer 38. 字符串的排列](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5dfv5h/) |
| **Day 29** | **动态规划(困难)** |
| | [剑指 Offer 19. 正则表达式匹配](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9a1ypc/) |
| | [剑指 Offer 49. 丑数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/9h3im5/) |
| | [剑指 Offer 60. n 个骰子的点数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/ozzl1r/) |
| **Day 30** | **分治算法(困难)** |
| | [剑指 Offer 17. 打印从 1 到最大的 n 位数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/594wfg/) |
| | [剑指 Offer 51. 数组中的逆序对](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/o58jfs/) |
| **Day 31** | **数学(困难)** |
| | [剑指 Offer 14- II. 剪绳子 II](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/5vcapc/) |
| | [剑指 Offer 43. 1n 整数中 1 出现的次数](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/572jxs/) |
| | [剑指 Offer 44. 数字序列中某一位的数字](https://leetcode-cn.com/leetbook/read/illustration-of-algorithm/57vzfh/) |
---
1. [Krahets 笔面试精选 88 题](https://leetcode.cn/studyplan/selected-coding-interview/):由“剑指 Offer”和“Hot 100”组成的高频面试题单
2. [图解算法数据结构](https://leetcode.cn/studyplan/coding-interviews/):题目更贴近实际应用,相对“剑指 Offer”难度有所增加。
## License
This work is licensed under CC-BY-SA-4.0 license.
The texts and figures in this repository are licensed under [CC BY-NC-SA-4.0 license](https://creativecommons.org/licenses/by-nc-sa/4.0/).
The sample code within this repository is made available under [MIT license](LICENSE-SAMPLECODE).