Skip to content

Commit dad0a3f

Browse files
authored
Prepare 1.2.0 release (#1585)
* Sync zh and zh-hant versions * Update the list of contributors. * Update time_complexity_simple_example.png * Reduce size of the RGBA images for zh-hant version. * Sync the zh-hant version of terminology.md * Prepare 1.2.0 release * Update the contributors list.
1 parent e41b0a3 commit dad0a3f

File tree

20 files changed

+54
-27
lines changed

20 files changed

+54
-27
lines changed
Loading

docs/chapter_preface/about_the_book.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
## 致谢
3232

33-
本书在开源社区众多贡献者的共同努力下不断完善。感谢每一位投入时间与精力的撰稿人,他们是(按照 GitHub 自动生成的顺序):krahets、Gonglja、nuomi1、codingonion、Reanon、justin-tse、hpstory、danielsss、curtishd、night-cruise、S-N-O-R-L-A-X、msk397、gvenusleo、RiverTwilight、gyt95、zhuoqinyue、Zuoxun、mingXta、hello-ikun、khoaxuantu、FangYuan33、GN-Yu、longsizhuo、mgisr、Cathay-Chen、guowei-gong、xBLACKICEx、K3v123、IsChristina、JoseHung、qualifier1024、pengchzn、Guanngxu、QiLOL、L-Super、WSL0809、Slone123c、lhxsm、yuan0221、what-is-me、rongyi、JeffersonHuang、longranger2、theNefelibatas、yuelinxin、xiongsp、nanlei、a16su、cy-by-side、gaofer、malone6、Wonderdch、hongyun-robot、XiaChuerwu、yd-j、bluebean-cloud、iron-irax、he-weilai、Nigh、MolDuM、Phoenix0415、XC-Zero、SamJin98、reeswell、NI-SW、Horbin-Magician、xjr7670、YangXuanyi、DullSword、iStig、qq909244296、jiaxianhua、wenjianmin、keshida、kilikilikid、lclc6、lwbaptx、luluxia、boloboloda、hts0000、gledfish、fbigm、echo1937、szu17dmy、dshlstarr、coderlef、czruby、beintentional、KeiichiKasai、xb534、ElaBosak233、baagod、zhouLion、yishangzhang、yi427、yabo083、weibk、wangwang105、th1nk3r-ing、tao363、4yDX3906、syd168、siqyka、selear、sdshaoda、noobcodemaker、chadyi、lyl625760、lucaswangdev、liuxjerry、0130w、shanghai-Jerry、JackYang-hellobobo、Javesun99、lipusheng、ShiMaRing、FreddieLi、FloranceYeh、Transmigration-zhou、fanchenggang、gltianwen、Dr-XYZ、curly210102、CuB3y0nd、youshaoXG、bubble9um、fanenr、52coder、foursevenlove、KorsChen、ZongYangL、hezhizhen、linzeyan、ZJKung、GaochaoZhu、yang-le、Evilrabbit520、Turing-1024-Lee、Suremotoo、Allen-Scai、Richard-Zhang1019、qingpeng9802、primexiao、nidhoggfgg、1ch0、MwumLi、ZnYang2018、hugtyftg、logan-qiu、psychelzh 和 Keynman 。
33+
本书在开源社区众多贡献者的共同努力下不断完善。感谢每一位投入时间与精力的撰稿人,他们是(按照 GitHub 自动生成的顺序):krahets、coderonion、Gonglja、nuomi1、Reanon、justin-tse、hpstory、danielsss、curtishd、night-cruise、S-N-O-R-L-A-X、msk397、gvenusleo、khoaxuantu、RiverTwilight、rongyi、gyt95、zhuoqinyue、K3v123、Zuoxun、mingXta、hello-ikun、FangYuan33、GN-Yu、yuelinxin、longsizhuo、Cathay-Chen、guowei-gong、xBLACKICEx、IsChristina、JoseHung、qualifier1024、QiLOL、pengchzn、Guanngxu、L-Super、WSL0809、Slone123c、lhxsm、yuan0221、what-is-me、theNefelibatas、longranger2、cy-by-side、xiongsp、JeffersonHuang、Transmigration-zhou、magentaqin、Wonderdch、malone6、xiaomiusa87、gaofer、bluebean-cloud、a16su、Shyam-Chen、nanlei、hongyun-robot、Phoenix0415、MolDuM、Nigh、he-weilai、junminhong、mgisr、iron-irax、yd-j、XiaChuerwu、XC-Zero、seven1240、SamJin98、wodray、reeswell、NI-SW、Horbin-Magician、Enlightenus、xjr7670、YangXuanyi、DullSword、boloboloda、iStig、qq909244296、jiaxianhua、wenjianmin、keshida、kilikilikid、lclc6、lwbaptx、liuxjerry、lucaswangdev、lyl625760、hts0000、gledfish、fbigm、echo1937、szu17dmy、dshlstarr、Yucao-cy、coderlef、czruby、bongbongbakudan、beintentional、ZongYangL、ZhongYuuu、luluxia、xb534、bitsmi、ElaBosak233、baagod、zhouLion、yishangzhang、yi427、yabo083、weibk、wangwang105、th1nk3r-ing、tao363、4yDX3906、syd168、steventimes、sslmj2020、smilelsb、siqyka、selear、sdshaoda、Xi-Row、popozhu、nuquist19、noobcodemaker、XiaoK29、chadyi、ZhongGuanbin、shanghai-Jerry、JackYang-hellobobo、Javesun99、lipusheng、BlindTerran、ShiMaRing、FreddieLi、FloranceYeh、iFleey、fanchenggang、gltianwen、goerll、Dr-XYZ、nedchu、curly210102、CuB3y0nd、KraHsu、CarrotDLaw、youshaoXG、bubble9um、fanenr、eagleanurag、LifeGoesOnionOnionOnion、52coder、foursevenlove、KorsChen、hezhizhen、linzeyan、ZJKung、GaochaoZhu、hopkings2008、yang-le、Evilrabbit520、Turing-1024-Lee、thomasq0、Suremotoo、Allen-Scai、Risuntsy、Richard-Zhang1019、qingpeng9802、primexiao、nidhoggfgg、1ch0、MwumLi、martinx、ZnYang2018、hugtyftg、logan-qiu、psychelzh、Keynman、KeiichiKasai 和 0130w。
3434

35-
本书的代码审阅工作由 codingonion、curtishd、Gonglja、gvenusleo、hpstory、justin-tse、khoaxuantu、krahets、night-cruise、nuomi1 和 Reanon 完成(按照首字母顺序排列)。感谢他们付出的时间与精力,正是他们确保了各语言代码的规范与统一。
35+
本书的代码审阅工作由 coderonion、curtishd、Gonglja、gvenusleo、hpstory、justin-tse、khoaxuantu、krahets、night-cruise、nuomi1、Reanonrongyi 完成(按照首字母顺序排列)。感谢他们付出的时间与精力,正是他们确保了各语言代码的规范与统一。
3636

3737
在本书的创作过程中,我得到了许多人的帮助。
3838

docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ <h3>作者</h3>
258258
<h3>代码审阅者</h3>
259259
<div class="profile-div">
260260
<div class="profile-cell">
261-
<a href="https://github.com/codingonion">
262-
<img class="profile-img" src="assets/avatar/avatar_codingonion.jpg" alt="Reviewer: codingonion" />
263-
<br><b>codingonion</b>
261+
<a href="https://github.com/coderonion">
262+
<img class="profile-img" src="assets/avatar/avatar_coderonion.jpg" alt="Reviewer: coderonion" />
263+
<br><b>coderonion</b>
264264
<br><sub>Zig, Rust</sub>
265265
</a>
266266
</div>

en/docs/chapter_preface/about_the_book.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ The main content of the book is shown in the figure below.
3030

3131
## Acknowledgements
3232

33-
This book is continuously improved with the joint efforts of many contributors from the open-source community. Thanks to each writer who invested their time and energy, listed in the order generated by GitHub: krahets, codingonion, nuomi1, Gonglja, Reanon, justin-tse, danielsss, hpstory, S-N-O-R-L-A-X, night-cruise, msk397, gvenusleo, RiverTwilight, gyt95, zhuoqinyue, Zuoxun, Xia-Sang, mingXta, FangYuan33, GN-Yu, IsChristina, xBLACKICEx, guowei-gong, Cathay-Chen, mgisr, JoseHung, qualifier1024, pengchzn, Guanngxu, longsizhuo, L-Super, what-is-me, yuan0221, lhxsm, Slone123c, WSL0809, longranger2, theNefelibatas, xiongsp, JeffersonHuang, hongyun-robot, K3v123, yuelinxin, a16su, gaofer, malone6, Wonderdch, xjr7670, DullSword, Horbin-Magician, NI-SW, reeswell, XC-Zero, XiaChuerwu, yd-j, iron-irax, huawuque404, MolDuM, Nigh, KorsChen, foursevenlove, 52coder, bubble9um, youshaoXG, curly210102, gltianwen, fanchenggang, Transmigration-zhou, FloranceYeh, FreddieLi, ShiMaRing, lipusheng, Javesun99, JackYang-hellobobo, shanghai-Jerry, 0130w, Keynman, psychelzh, logan-qiu, ZnYang2018, MwumLi, 1ch0, Phoenix0415, qingpeng9802, Richard-Zhang1019, QiLOL, Suremotoo, Turing-1024-Lee, Evilrabbit520, GaochaoZhu, ZJKung, linzeyan, hezhizhen, ZongYangL, beintentional, czruby, coderlef, dshlstarr, szu17dmy, fbigm, gledfish, hts0000, boloboloda, iStig, jiaxianhua, wenjianmin, keshida, kilikilikid, lclc6, lwbaptx, liuxjerry, lucaswangdev, lyl625760, chadyi, noobcodemaker, selear, siqyka, syd168, 4yDX3906, tao363, wangwang105, weibk, yabo083, yi427, yishangzhang, zhouLion, baagod, ElaBosak233, xb534, luluxia, yanedie, thomasq0, YangXuanyi and th1nk3r-ing.
33+
This book is continuously improved with the joint efforts of many contributors from the open-source community. Thanks to each writer who invested their time and energy, listed in the order generated by GitHub: krahets, coderonion, Gonglja, nuomi1, Reanon, justin-tse, hpstory, danielsss, curtishd, night-cruise, S-N-O-R-L-A-X, msk397, gvenusleo, khoaxuantu, RiverTwilight, rongyi, gyt95, zhuoqinyue, K3v123, Zuoxun, mingXta, hello-ikun, FangYuan33, GN-Yu, yuelinxin, longsizhuo, Cathay-Chen, guowei-gong, xBLACKICEx, IsChristina, JoseHung, qualifier1024, QiLOL, pengchzn, Guanngxu, L-Super, WSL0809, Slone123c, lhxsm, yuan0221, what-is-me, theNefelibatas, longranger2, cy-by-side, xiongsp, JeffersonHuang, Transmigration-zhou, magentaqin, Wonderdch, malone6, xiaomiusa87, gaofer, bluebean-cloud, a16su, Shyam-Chen, nanlei, hongyun-robot, Phoenix0415, MolDuM, Nigh, he-weilai, junminhong, mgisr, iron-irax, yd-j, XiaChuerwu, XC-Zero, seven1240, SamJin98, wodray, reeswell, NI-SW, Horbin-Magician, Enlightenus, xjr7670, YangXuanyi, DullSword, boloboloda, iStig, qq909244296, jiaxianhua, wenjianmin, keshida, kilikilikid, lclc6, lwbaptx, liuxjerry, lucaswangdev, lyl625760, hts0000, gledfish, fbigm, echo1937, szu17dmy, dshlstarr, Yucao-cy, coderlef, czruby, bongbongbakudan, beintentional, ZongYangL, ZhongYuuu, luluxia, xb534, bitsmi, ElaBosak233, baagod, zhouLion, yishangzhang, yi427, yabo083, weibk, wangwang105, th1nk3r-ing, tao363, 4yDX3906, syd168, steventimes, sslmj2020, smilelsb, siqyka, selear, sdshaoda, Xi-Row, popozhu, nuquist19, noobcodemaker, XiaoK29, chadyi, ZhongGuanbin, shanghai-Jerry, JackYang-hellobobo, Javesun99, lipusheng, BlindTerran, ShiMaRing, FreddieLi, FloranceYeh, iFleey, fanchenggang, gltianwen, goerll, Dr-XYZ, nedchu, curly210102, CuB3y0nd, KraHsu, CarrotDLaw, youshaoXG, bubble9um, fanenr, eagleanurag, LifeGoesOnionOnionOnion, 52coder, foursevenlove, KorsChen, hezhizhen, linzeyan, ZJKung, GaochaoZhu, hopkings2008, yang-le, Evilrabbit520, Turing-1024-Lee, thomasq0, Suremotoo, Allen-Scai, Risuntsy, Richard-Zhang1019, qingpeng9802, primexiao, nidhoggfgg, 1ch0, MwumLi, martinx, ZnYang2018, hugtyftg, logan-qiu, psychelzh, Keynman, KeiichiKasai and 0130w.
3434

35-
The code review work for this book was completed by codingonion, Gonglja, gvenusleo, hpstory, justin‐tse, khoaxuantu, krahets, night-cruise, nuomi1, and Reanon (listed in alphabetical order). Thanks to them for their time and effort, ensuring the standardization and uniformity of the code in various languages.
35+
The code review work for this book was completed by coderonion, Gonglja, gvenusleo, hpstory, justin‐tse, khoaxuantu, krahets, night-cruise, nuomi1, Reanon and rongyi (listed in alphabetical order). Thanks to them for their time and effort, ensuring the standardization and uniformity of the code in various languages.
3636

3737
Throughout the creation of this book, numerous individuals provided invaluable assistance, including but not limited to:
3838

en/docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,9 @@ <h3>Author</h3>
258258
<h3>Code reviewers</h3>
259259
<div class="profile-div">
260260
<div class="profile-cell">
261-
<a href="https://github.com/codingonion">
262-
<img class="profile-img" src="../assets/avatar/avatar_codingonion.jpg" alt="Reviewer: codingonion" />
263-
<br><b>codingonion</b>
261+
<a href="https://github.com/coderonion">
262+
<img class="profile-img" src="../assets/avatar/avatar_coderonion.jpg" alt="Reviewer: coderonion" />
263+
<br><b>coderonion</b>
264264
<br><sub>Zig, Rust</sub>
265265
</a>
266266
</div>

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ site_dir: site
99
repo_name: krahets/hello-algo
1010
repo_url: https://github.com/krahets/hello-algo
1111
edit_uri: tree/main/docs
12-
version: 1.1.0
12+
version: 1.2.0
1313

1414
# Copyright
1515
copyright: Copyright &copy; 2024 krahets<br>The website content is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>

zh-hant/codes/c/chapter_stack_and_queue/array_deque.c

+19-6
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,29 @@ int popLast(ArrayDeque *deque) {
111111
return num;
112112
}
113113

114+
/* 返回陣列用於列印 */
115+
int *toArray(ArrayDeque *deque, int *queSize) {
116+
*queSize = deque->queSize;
117+
int *res = (int *)calloc(deque->queSize, sizeof(int));
118+
int j = deque->front;
119+
for (int i = 0; i < deque->queSize; i++) {
120+
res[i] = deque->nums[j % deque->queCapacity];
121+
j++;
122+
}
123+
return res;
124+
}
125+
114126
/* Driver Code */
115127
int main() {
116128
/* 初始化佇列 */
117129
int capacity = 10;
130+
int queSize;
118131
ArrayDeque *deque = newArrayDeque(capacity);
119132
pushLast(deque, 3);
120133
pushLast(deque, 2);
121134
pushLast(deque, 5);
122135
printf("雙向佇列 deque = ");
123-
printArray(deque->nums, deque->queSize);
136+
printArray(toArray(deque, &queSize), queSize);
124137

125138
/* 訪問元素 */
126139
int peekFirstNum = peekFirst(deque);
@@ -131,18 +144,18 @@ int main() {
131144
/* 元素入列 */
132145
pushLast(deque, 4);
133146
printf("元素 4 佇列尾入列後 deque = ");
134-
printArray(deque->nums, deque->queSize);
147+
printArray(toArray(deque, &queSize), queSize);
135148
pushFirst(deque, 1);
136149
printf("元素 1 佇列首入列後 deque = ");
137-
printArray(deque->nums, deque->queSize);
150+
printArray(toArray(deque, &queSize), queSize);
138151

139152
/* 元素出列 */
140153
int popLastNum = popLast(deque);
141154
printf("佇列尾出列元素 = %d ,佇列尾出列後 deque= ", popLastNum);
142-
printArray(deque->nums, deque->queSize);
155+
printArray(toArray(deque, &queSize), queSize);
143156
int popFirstNum = popFirst(deque);
144157
printf("佇列首出列元素 = %d ,佇列首出列後 deque= ", popFirstNum);
145-
printArray(deque->nums, deque->queSize);
158+
printArray(toArray(deque, &queSize), queSize);
146159

147160
/* 獲取佇列的長度 */
148161
int dequeSize = size(deque);
@@ -156,4 +169,4 @@ int main() {
156169
delArrayDeque(deque);
157170

158171
return 0;
159-
}
172+
}

zh-hant/codes/c/chapter_stack_and_queue/array_queue.c

+17-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,23 @@ int pop(ArrayQueue *queue) {
7474
return num;
7575
}
7676

77+
/* 返回陣列用於列印 */
78+
int *toArray(ArrayQueue *queue, int *queSize) {
79+
*queSize = queue->queSize;
80+
int *res = (int *)calloc(queue->queSize, sizeof(int));
81+
int j = queue->front;
82+
for (int i = 0; i < queue->queSize; i++) {
83+
res[i] = queue->nums[j % queue->queCapacity];
84+
j++;
85+
}
86+
return res;
87+
}
88+
7789
/* Driver Code */
7890
int main() {
7991
/* 初始化佇列 */
8092
int capacity = 10;
93+
int queSize;
8194
ArrayQueue *queue = newArrayQueue(capacity);
8295

8396
/* 元素入列 */
@@ -87,7 +100,7 @@ int main() {
87100
push(queue, 5);
88101
push(queue, 4);
89102
printf("佇列 queue = ");
90-
printArray(queue->nums, queue->queSize);
103+
printArray(toArray(queue, &queSize), queSize);
91104

92105
/* 訪問佇列首元素 */
93106
int peekNum = peek(queue);
@@ -96,7 +109,7 @@ int main() {
96109
/* 元素出列 */
97110
peekNum = pop(queue);
98111
printf("出列元素 pop = %d ,出列後 queue = ", peekNum);
99-
printArray(queue->nums, queue->queSize);
112+
printArray(toArray(queue, &queSize), queSize);
100113

101114
/* 獲取佇列的長度 */
102115
int queueSize = size(queue);
@@ -111,11 +124,11 @@ int main() {
111124
push(queue, i);
112125
pop(queue);
113126
printf("第 %d 輪入列 + 出列後 queue = ", i);
114-
printArray(queue->nums, queue->queSize);
127+
printArray(toArray(queue, &queSize), queSize);
115128
}
116129

117130
// 釋放記憶體
118131
delArrayQueue(queue);
119132

120133
return 0;
121-
}
134+
}
Loading
Loading
Loading

zh-hant/docs/chapter_appendix/terminology.md

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
| front of the queue | 队首 | 佇列首 |
5151
| rear of the queue | 队尾 | 佇列尾 |
5252
| hash table | 哈希表 | 雜湊表 |
53+
| hash set | 哈希集合 | 雜湊集合 |
5354
| bucket |||
5455
| hash function | 哈希函数 | 雜湊函式 |
5556
| hash collision | 哈希冲突 | 雜湊衝突 |

0 commit comments

Comments
 (0)