Skip to content

Commit

Permalink
docs: prettify code
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme authored and actions-user committed Oct 20, 2020
1 parent 52d4424 commit 7a7d3f2
Show file tree
Hide file tree
Showing 3,656 changed files with 32,055 additions and 44,820 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 6 additions & 6 deletions .docsifytopdfrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
contents: [ "summary.md" ],
pathToPublic: "pdf/advanced-java.pdf",
pdfOptions: "<options for puppeteer.pdf()>",
removeTemp: true,
emulateMedia: "screen",
}
contents: ["summary.md"],
pathToPublic: "pdf/advanced-java.pdf",
pdfOptions: "<options for puppeteer.pdf()>",
removeTemp: true,
emulateMedia: "screen",
};
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

## 加入我们

刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」​本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 [@kfstorm](https://github.com/kfstorm) 贡献了本项目的所有 [C# 题解](https://github.com/doocs/leetcode/pull/245)
刷编程题的最大好处就是可以锻炼解决问题的思维能力。相信我,「如何去思考」​ 本身也是一项需要不断学习和练习的技能。非常感谢前微软工程师、现蚂蚁金服技术专家 [@kfstorm](https://github.com/kfstorm) 贡献了本项目的所有 [C# 题解](https://github.com/doocs/leetcode/pull/245)

如果你对本项目感兴趣,并且希望加入我们刷题大军,欢迎随时提交 [PR](https://github.com/doocs/leetcode/pulls)。请参考如下步骤:

Expand Down Expand Up @@ -111,10 +111,10 @@

<a href="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890" target="_blank"><img src="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890"></a>

> "*You help the developer community practice for interviews, and there is nothing better we could ask for.*" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
> "_You help the developer community practice for interviews, and there is nothing better we could ask for._" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
## 许可证

<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">知识共享 版权归属-相同方式共享 4.0 国际 公共许可证</a>

<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
13 changes: 5 additions & 8 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
## Solutions

1. [LeetCode](/solution/README_EN.md)
1. [LCOF: *Coding Interviews, 2nd Edition*](/lcof/README_EN.md)
1. [LCCI: *Cracking the Coding Interview, 6th Edition*](/lcci/README_EN.md)
1. [LCOF: _Coding Interviews, 2nd Edition_](/lcof/README_EN.md)
1. [LCCI: _Cracking the Coding Interview, 6th Edition_](/lcci/README_EN.md)

## Basic Algorithms

Expand All @@ -54,7 +54,6 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF
1. [Lowest Common Ancestor of a Binary Tree](/solution/0200-0299/0236.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Tree/README_EN.md)
1. [Lowest Common Ancestor of a Binary Search Tree](/solution/0200-0299/0235.Lowest%20Common%20Ancestor%20of%20a%20Binary%20Search%20Tree/README_EN.md)


### Math

1. [Set Mismatch](/solution/0600-0699/0645.Set%20Mismatch/README_EN.md)
Expand All @@ -65,7 +64,6 @@ Complete solutions to [LeetCode](https://leetcode-cn.com/problemset/all/), [LCOF

### Misc


## Maintainer

[Yang Libin](https://github.com/yanglbme): Creator of [@Doocs](https://github.com/doocs) technical community; member of [@TheAlgorithms](https://github.com/TheAlgorithms) organization.
Expand All @@ -89,7 +87,7 @@ You can also contribute to [doocs/leetcode](https://github.com/doocs/leetcode) u

## Contributors

This project exists thanks to all the people who contribute.
This project exists thanks to all the people who contribute.

<a href="https://opencollective.com/doocs-leetcode/contributors.svg?width=890&button=true" target="_blank"><img src="https://opencollective.com/doocs-leetcode/contributors.svg?width=890&button=false" /></a>

Expand All @@ -101,11 +99,10 @@ Thank you to all our backers and sponsors!

<a href="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890" target="_blank"><img src="https://opencollective.com/doocs-leetcode/sponsors.svg?width=890"></a>


> "*You help the developer community practice for interviews, and there is nothing better we could ask for.*" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
> "_You help the developer community practice for interviews, and there is nothing better we could ask for._" -- [Alan Yessenbayev](https://opencollective.com/alan-yessenbayev)
## License

This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.

<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
<a rel="license" href="https://github.com/doocs/leetcode/blob/master/LICENSE"><img alt="Creative Commons License" style="border-width:0" src="./images/cc-by-sa-88x31.png" /></a>
2 changes: 1 addition & 1 deletion basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
- [冒泡排序](./sorting/BubbleSort/README.md)
- [插入排序](./sorting/InsertionSort/README.md)
- [归并排序](./sorting/MergeSort/README.md)
- [快速排序](./sorting/QuickSort/README.md)
- [快速排序](./sorting/QuickSort/README.md)
2 changes: 1 addition & 1 deletion basic/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
- [Bubble Sort](./sorting/BubbleSort/README.md)
- [Insertion Sort](./sorting/InsertionSort/README.md)
- [Merge Sort](./sorting/MergeSort/README.md)
- [Quick Sort](./sorting/QuickSort/README.md)
- [Quick Sort](./sorting/QuickSort/README.md)
2 changes: 1 addition & 1 deletion basic/sorting/BubbleSort/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ public class BubbleSort {

因此,时间复杂度是 O(n²),这是一种稳定的排序算法。

> 稳定是指,两个相等的数,在排序过后,相对位置保持不变。
> 稳定是指,两个相等的数,在排序过后,相对位置保持不变。
2 changes: 1 addition & 1 deletion basic/sorting/MergeSort/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public class MergeSort {

由于合并 n 个元素需要分配一个大小为 n 的额外数组,所以空间复杂度为 O(n)。

这是一种稳定的排序算法。
这是一种稳定的排序算法。
3 changes: 1 addition & 2 deletions basic/sorting/QuickSort/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# 快速排序

快速排序也采用了分治的思想:把原始的数组筛选成较小和较大的两个子数组,然后递归地排序两个子数组。
Expand Down Expand Up @@ -68,4 +67,4 @@ public class QuickSort {

但是,如果每次在选择基准值的时候,都不幸地选择了子数组里的最大或最小值。即每次把把数组分成了两个更小长度的数组,其中一个长度为 1,另一个的长度是子数组的长度减 1。这样的算法复杂度变成 O(n²)。

和归并排序不同,快速排序在每次递归的过程中,只需要开辟 O(1) 的存储空间来完成操作来实现对数组的修改;而递归次数为 logn,所以它的整体空间复杂度完全取决于压堆栈的次数。
和归并排序不同,快速排序在每次递归的过程中,只需要开辟 O(1) 的存储空间来完成操作来实现对数组的修改;而递归次数为 logn,所以它的整体空间复杂度完全取决于压堆栈的次数。
10 changes: 5 additions & 5 deletions basic/summary.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- 基础算法通关
- 常见的排序算法
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
- [插入排序](/basic/sorting/InsertionSort/README.md)
- [归并排序](/basic/sorting/MergeSort/README.md)
- [快速排序](/basic/sorting/QuickSort/README.md)
- 常见的排序算法
- [冒泡排序](/basic/sorting/BubbleSort/README.md)
- [插入排序](/basic/sorting/InsertionSort/README.md)
- [归并排序](/basic/sorting/MergeSort/README.md)
- [快速排序](/basic/sorting/QuickSort/README.md)
10 changes: 7 additions & 3 deletions lcci/01.01.Is Unique/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[English Version](/lcci/01.01.Is%20Unique/README_EN.md)

## 题目描述

<!-- 这里写题目描述 -->
<p>实现一个算法,确定一个字符串 <code>s</code> 的所有字符是否全都不同。</p>

Expand All @@ -23,15 +24,16 @@
<li><code>0 <= len(s) <= 100 </code></li>
<li>如果你不使用额外的数据结构,会很加分。</li>
</ul>


## 解法
<!-- 这里可写通用的实现逻辑 -->

<!-- 这里可写通用的实现逻辑 -->

<!-- tabs:start -->

### **Python3**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```python
Expand All @@ -42,6 +44,7 @@ class Solution:
```

### **Java**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```java
Expand All @@ -62,8 +65,9 @@ class Solution {
```

### **...**

```
```

<!-- tabs:end -->
<!-- tabs:end -->
8 changes: 3 additions & 5 deletions lcci/01.01.Is Unique/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[中文文档](/lcci/01.01.Is%20Unique/README.md)

## Description

<p>Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?</p>

<p><strong>Example 1:</strong></p>
Expand Down Expand Up @@ -31,12 +32,8 @@
<li><code>0 &lt;= len(s) &lt;= 100 </code></li>
</ul>




## Solutions


<!-- tabs:start -->

### **Python3**
Expand Down Expand Up @@ -68,8 +65,9 @@ class Solution {
```

### **...**

```
```

<!-- tabs:end -->
<!-- tabs:end -->
9 changes: 6 additions & 3 deletions lcci/01.02.Check Permutation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[English Version](/lcci/01.02.Check%20Permutation/README_EN.md)

## 题目描述

<!-- 这里写题目描述 -->
<p>给定两个字符串 <code>s1</code> 和 <code>s2</code>,请编写一个程序,确定其中一个字符串的字符重新排列后,能否变成另一个字符串。</p>

Expand All @@ -25,14 +26,14 @@
<li><code>0 &lt;= len(s2) &lt;= 100 </code></li>
</ul>


## 解法
<!-- 这里可写通用的实现逻辑 -->

<!-- 这里可写通用的实现逻辑 -->

<!-- tabs:start -->

### **Python3**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```python
Expand All @@ -42,6 +43,7 @@ class Solution:
```

### **Java**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```java
Expand All @@ -60,8 +62,9 @@ class Solution {
```

### **...**

```
```

<!-- tabs:end -->
<!-- tabs:end -->
18 changes: 3 additions & 15 deletions lcci/01.02.Check Permutation/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
[中文文档](/lcci/01.02.Check%20Permutation/README.md)

## Description
<p>Given two strings,write a method to decide if one is a permutation of the other.</p>


<p>Given two strings,write a method to decide if one is a permutation of the other.</p>

<p><strong>Example 1:</strong></p>



<pre>

<strong>Input: </strong><code>s1</code> = &quot;abc&quot;, <code>s2</code> = &quot;bca&quot;
Expand All @@ -19,12 +16,8 @@

</pre>



<p><strong>Example 2:</strong></p>



<pre>

<strong>Input: </strong><code>s1</code> = &quot;abc&quot;, <code>s2</code> = &quot;bad&quot;
Expand All @@ -33,20 +26,14 @@

</pre>



<p><strong>Note:</strong></p>
<ol>
<li><code>0 &lt;= len(s1) &lt;= 100 </code></li>
<li><code>0 &lt;= len(s2) &lt;= 100</code></li>
</ol>




## Solutions


<!-- tabs:start -->

### **Python3**
Expand Down Expand Up @@ -75,8 +62,9 @@ class Solution {
```

### **...**

```
```

<!-- tabs:end -->
<!-- tabs:end -->
11 changes: 7 additions & 4 deletions lcci/01.03.String to URL/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# [面试题 01.03. URL化](https://leetcode-cn.com/problems/string-to-url-lcci)
# [面试题 01.03. URL 化](https://leetcode-cn.com/problems/string-to-url-lcci)

[English Version](/lcci/01.03.String%20to%20URL/README_EN.md)

## 题目描述

<!-- 这里写题目描述 -->
<p>URL化。编写一种方法,将字符串中的空格全部替换为<code>%20</code>。假定该字符串尾部有足够的空间存放新增字符,并且知道字符串的&ldquo;真实&rdquo;长度。(注:用<code>Java</code>实现的话,请使用字符数组实现,以便直接在数组上操作。)</p>

Expand All @@ -24,14 +25,14 @@
<li>字符串长度在[0, 500000]范围内。</li>
</ol>


## 解法
<!-- 这里可写通用的实现逻辑 -->

<!-- 这里可写通用的实现逻辑 -->

<!-- tabs:start -->

### **Python3**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```python
Expand All @@ -42,6 +43,7 @@ class Solution:
```

### **Java**

<!-- 这里可写当前语言的特殊实现逻辑 -->

```java
Expand All @@ -64,8 +66,9 @@ class Solution {
```

### **...**

```
```

<!-- tabs:end -->
<!-- tabs:end -->
Loading

0 comments on commit 7a7d3f2

Please sign in to comment.