Skip to content

Commit 8c74545

Browse files
authored
Merge pull request greyireland#39 from chienmy/master
Java版完成打卡
2 parents 0c6abaf + caa8928 commit 8c74545

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,4 @@
102102
|| [dashidhy](https://github.com/dashidhy) | [algorithm-pattern-python(Python 实现)](https://github.com/dashidhy/algorithm-pattern-python) |
103103
|| [binzi56](https://github.com/binzi56) | [algorithm-pattern-c(c++ 实现)](https://github.com/binzi56/algorithm-pattern-c) |
104104
|| [lvseouren](https://github.com/lvseouren) | [algorithm-study-record(c++ 实现)](https://github.com/lvseouren/algorithm-study-record) |
105+
|| [chienmy](https://github.com/chienmy) | [algorithm-pattern-java(Java 实现)](https://github.com/chienmy/algorithm-pattern-java), [在线文档 Gitbook](https://chienmy.gitbook.io/algorithm-pattern-java/) |

basic_algorithm/sort.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ func sink(a []int, i int, length int) {
121121
for {
122122
// 左节点索引(从0开始,所以左节点为i*2+1)
123123
l := i*2 + 1
124-
// 有节点索引
124+
// 右节点索引
125125
r := i*2 + 2
126126
// idx保存根、左、右三者之间较大值的索引
127127
idx := i
128128
// 存在左节点,左节点值较大,则取左节点
129129
if l < length && a[l] > a[idx] {
130130
idx = l
131131
}
132-
// 存在有节点,且值较大,取右节点
132+
// 存在右节点,且值较大,取右节点
133133
if r < length && a[r] > a[idx] {
134134
idx = r
135135
}

0 commit comments

Comments
 (0)