Skip to content

Commit

Permalink
auto commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CyC2018 committed Feb 17, 2019
1 parent 12dc592 commit dfd1006
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 3 deletions.
Binary file added docs/notes/pics/2_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/notes/pics/3_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/notes/pics/61550402057509.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/notes/算法.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public class Shell<T extends Comparable<T>> extends Sort<T> {

归并排序的思想是将数组分成两部分,分别进行排序,然后归并起来。

<div align="center"> <img src="pics/220790c6-4377-4a2e-8686-58398afc8a18.png" width="350"/> </div><br>
<div align="center"> <img src="pics/2_200.png"/> </div><br>

### 1. 归并方法

Expand Down Expand Up @@ -511,7 +511,7 @@ public class Down2UpMergeSort<T extends Comparable<T>> extends MergeSort<T> {
- 归并排序将数组分为两个子数组分别排序,并将有序的子数组归并使得整个数组排序;
- 快速排序通过一个切分元素将数组分为两个子数组,左子数组小于等于切分元素,右子数组大于等于切分元素,将这两个子数组排序也就将整个数组排序了。

<div align="center"> <img src="pics/f8047846-efd4-42be-b6b7-27a7c4998b51.png" width="500"/> </div><br>
<div align="center"> <img src="pics/3_200.png"/> </div><br>

```java
public class QuickSort<T extends Comparable<T>> extends Sort<T> {
Expand Down Expand Up @@ -542,7 +542,7 @@ public class QuickSort<T extends Comparable<T>> extends Sort<T> {

取 a[l] 作为切分元素,然后从数组的左端向右扫描直到找到第一个大于等于它的元素,再从数组的右端向左扫描找到第一个小于它的元素,交换这两个元素。不断进行这个过程,就可以保证左指针 i 的左侧元素都不大于切分元素,右指针 j 的右侧元素都不小于切分元素。当两个指针相遇时,将切分元素 a[l] 和 a[j] 交换位置。

<div align="center"> <img src="pics/766aedd0-1b00-4065-aa2b-7d31138df84f.png" width="400"/> </div><br>
<div align="center"> <img src="pics/61550402057509.gif"/> </div><br>

```java
private int partition(T[] nums, int l, int h) {
Expand Down
Binary file added docs/pics/2_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/3_200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pics/61550402057509.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dfd1006

Please sign in to comment.