Skip to content

Commit d7b2277

Browse files
authored
Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4 * Retranslate Japanese code with GPT-5.4
1 parent fe64432 commit d7b2277

1,444 files changed

Lines changed: 83306 additions & 8357 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ja/CONTRIBUTING.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

ja/README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
<p align="center">
77
<img style="height: 60px;" src="https://readme-typing-svg.demolab.com?font=Noto+Sans+JP&weight=400&duration=3500&pause=2000&color=21C8B8&center=true&vCenter=true&random=false&width=200&lines=Hello,+%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0+!" alt="hello-algo-typing-svg" />
88
</br>
9-
アニメーションで図解、ワンクリック実行のデータ構造とアルゴリズム入門講座
9+
アニメーション図解とワンクリック実行コードで学べる、データ構造とアルゴリズムの入門書
1010
</p>
1111

1212
<p align="center">
1313
<a href="https://www.hello-algo.com/ja/">
1414
<img src="https://www.hello-algo.com/en/index.assets/btn_read_online_dark.svg" height="45"></a>
15+
<a href="https://github.com/krahets/hello-algo/releases">
16+
<img src="https://www.hello-algo.com/en/index.assets/btn_download_pdf_epub_dark.svg" height="45"></a>
1517
</p>
1618

1719
<p align="center">
@@ -49,47 +51,45 @@
4951

5052
## この本について
5153

52-
このオープンソースプロジェクトは、データ構造とアルゴリズムの無料で初心者向けの入門講座を作成することを目的としています
54+
本プロジェクトは、無料かつオープンソースで、初心者にもやさしいデータ構造とアルゴリズムの入門書を作ることを目的としています
5355

54-
- アニメーションによる図解、わかりやすい内容、なめらかな学習曲線により、初心者がデータ構造とアルゴリズムの「知識マップ」を探索できます
55-
- ワンクリックでコードを実行でき、読者のプログラミングスキルを向上させ、アルゴリズムの動作原理とデータ構造の基礎となる実装を理解できます
56-
- 教えることで学ぶことを促進し、質問や洞察を自由に共有してください。議論を通じて一緒に成長しましょう
56+
- 全編をアニメーション図解で構成し、わかりやすい内容と無理のない学習曲線によって、初学者がデータ構造とアルゴリズムの知識地図をたどれるようにしています
57+
- ソースコードはワンクリックで実行でき、演習を通してプログラミング力を高めながら、アルゴリズムの動作原理とデータ構造の内部実装を理解できます
58+
- 学び合いを大切にしており、コメント欄での質問や知見の共有を歓迎します。議論を通じて一緒に成長していきましょう
5759

58-
この本が役立つと思われた場合は、スター :star: を付けてサポートしてください。ありがとうございます
60+
本書が役に立ったら、ページ右上の Star :star: で応援していただけると嬉しいです。ありがとうございます
5961

6062
## 推薦の言葉
6163

62-
> データ構造とアルゴリズムに関するわかりやすい本で、読者が頭と手を使って学ぶように導きます。アルゴリズム初心者に強くお勧めします!
64+
> 「平易でわかりやすいデータ構造・アルゴリズム入門書であり、読者を頭と手の両方を使う学びへと導いてくれます。アルゴリズム初学者に強く薦めます。」
6365
>
64-
> **—— 邓俊辉,清華大学コンピュータサイエンス技術学部**
66+
> **—— 邓俊辉,清華大学計算機科学技術学部教授**
6567
66-
> データ構造とアルゴリズムを学んでいたときに『Hello Algo』があったなら、10 倍簡単だったでしょう!
68+
> 「もし当時『Hello Algo』があれば、データ構造とアルゴリズムの学習は 10 倍は楽だったはずです!」
6769
>
68-
> **—— 李沐,Amazon シニアプリンシパルサイエンティスト**
70+
> **—— 李沐,Amazon シニア・プリンシパル・サイエンティスト**
6971
70-
## 特別な感謝
72+
## 謝辞
7173

7274
<p align="left">
7375
<a href="https://go.warp.dev/hello-algo">
7476
<img src="https://github.com/warpdotdev/brand-assets/blob/main/Github/Sponsor/Warp-Github-LG-02.png" alt="Warp-Github-LG-02" width="500"></a>
7577
</p>
7678

77-
[Warp は複数の AI エージェントと共にコーディングするために構築されています](https://go.warp.dev/hello-algo)
79+
[Warp は複数の AI エージェントとともにコーディングするために作られています](https://go.warp.dev/hello-algo)
7880

79-
## 貢献
81+
Warp ターミナルは、洗練された UI と使いやすい AI を兼ね備えており、非常に優れた体験を提供してくれます。
8082

81-
> [!Important]
82-
>
83-
> 日本語版の翻訳作業へのご参加を歓迎します!詳細は [CONTRIBUTING.md](CONTRIBUTING.md) をご覧ください。
83+
## 貢献
8484

85-
このオープンソースブックは継続的に更新されており、読者により良い学習コンテンツを提供するため、このプロジェクトへの参加を歓迎します
85+
本書は現在も継続的に更新されており、読者により良い学習コンテンツを届けるため、プロジェクトへの参加を歓迎しています
8686

87-
- [内容の修正](https://www.hello-algo.com/ja/chapter_appendix/contribution/)文法エラー、内容の欠落、曖昧さ、無効なリンク、コードのバグなど、コメントセクションで間違いを修正したり指摘したりしてください
88-
- [コードの移植](https://github.com/krahets/hello-algo/issues/15)さまざまなプログラミング言語でのご貢献をお待ちしています。現在、Python、Java、C++、Go、JavaScript を含む 12 言語をサポートしています
87+
- [内容の修正](https://www.hello-algo.com/ja/chapter_appendix/contribution/)文法ミス、内容の欠落、表現の曖昧さ、無効なリンク、コードのバグなどがあれば、修正またはコメント欄でのご指摘をお願いします
88+
- [コードの移植](https://github.com/krahets/hello-algo/issues/15):Python、Java、C++、Go、JavaScript など、現在対応している 12 言語のコード整備への貢献をお待ちしています
8989

90-
貴重なご提案とフィードバックを歓迎します。ご質問がある場合は、Issues を提出するか、WeChat`krahets-jyd` でお問い合わせください
90+
ご意見・ご提案を歓迎します。ご不明点があれば Issue を作成するか、WeChat`krahets-jyd` までご連絡ください
9191

92-
この本のすべての貢献者に感謝を捧げたいと思います。彼らの無私の献身により、この本がより良いものになりました。貢献者の皆様:
92+
本書をより良いものにしてくれた、すべての執筆・貢献者の皆さんに感謝します。無私の協力によって、このオープンソース書籍は支えられています。
9393

9494
<p align="left">
9595
<a href="https://github.com/krahets/hello-algo/graphs/contributors">
@@ -99,4 +99,4 @@
9999

100100
## ライセンス
101101

102-
このリポジトリ内のテキスト、コード、画像、写真、動画は [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) の下でライセンスされています。
102+
このリポジトリに含まれるテキスト、コード、画像、写真、動画は[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) の下でライセンスされています。

ja/codes/c/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Ignore all
2+
*
3+
# Unignore all with extensions
4+
!*.*
5+
# Unignore all dirs
6+
!*/
7+
*.dSYM/
8+
9+
build/

ja/codes/c/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
project(hello_algo C)
3+
4+
set(CMAKE_C_STANDARD 11)
5+
6+
include_directories(./include)
7+
8+
add_subdirectory(chapter_computational_complexity)
9+
add_subdirectory(chapter_array_and_linkedlist)
10+
add_subdirectory(chapter_stack_and_queue)
11+
add_subdirectory(chapter_hashing)
12+
add_subdirectory(chapter_tree)
13+
add_subdirectory(chapter_heap)
14+
add_subdirectory(chapter_graph)
15+
add_subdirectory(chapter_searching)
16+
add_subdirectory(chapter_sorting)
17+
add_subdirectory(chapter_divide_and_conquer)
18+
add_subdirectory(chapter_backtracking)
19+
add_subdirectory(chapter_dynamic_programming)
20+
add_subdirectory(chapter_greedy)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_executable(array array.c)
2+
add_executable(linked_list linked_list.c)
3+
add_executable(my_list my_list.c)
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/**
2+
* File: array.c
3+
* Created Time: 2022-12-20
4+
* Author: MolDuM (moldum@163.com)
5+
*/
6+
7+
#include "../utils/common.h"
8+
9+
/* 要素へランダムアクセス */
10+
int randomAccess(int *nums, int size) {
11+
// 区間 [0, size) からランダムに 1 つの数を選ぶ
12+
int randomIndex = rand() % size;
13+
// ランダムな要素を取得して返す
14+
int randomNum = nums[randomIndex];
15+
return randomNum;
16+
}
17+
18+
/* 配列長を拡張する */
19+
int *extend(int *nums, int size, int enlarge) {
20+
// 拡張後の長さを持つ配列を初期化する
21+
int *res = (int *)malloc(sizeof(int) * (size + enlarge));
22+
// 元の配列の全要素を新しい配列にコピー
23+
for (int i = 0; i < size; i++) {
24+
res[i] = nums[i];
25+
}
26+
// 拡張後の領域を初期化する
27+
for (int i = size; i < size + enlarge; i++) {
28+
res[i] = 0;
29+
}
30+
// 拡張後の新しい配列を返す
31+
return res;
32+
}
33+
34+
/* 配列の index 番目に要素 num を挿入 */
35+
void insert(int *nums, int size, int num, int index) {
36+
// インデックス index 以降の全要素を 1 つ後ろへ移動する
37+
for (int i = size - 1; i > index; i--) {
38+
nums[i] = nums[i - 1];
39+
}
40+
// index の要素に num を代入する
41+
nums[index] = num;
42+
}
43+
44+
/* index の要素を削除する */
45+
// 注意: stdio.h が remove 識別子を使用している
46+
void removeItem(int *nums, int size, int index) {
47+
// インデックス index より後ろの全要素を 1 つ前へ移動する
48+
for (int i = index; i < size - 1; i++) {
49+
nums[i] = nums[i + 1];
50+
}
51+
}
52+
53+
/* 配列を走査 */
54+
void traverse(int *nums, int size) {
55+
int count = 0;
56+
// インデックスで配列を走査
57+
for (int i = 0; i < size; i++) {
58+
count += nums[i];
59+
}
60+
}
61+
62+
/* 配列内で指定要素を探す */
63+
int find(int *nums, int size, int target) {
64+
for (int i = 0; i < size; i++) {
65+
if (nums[i] == target)
66+
return i;
67+
}
68+
return -1;
69+
}
70+
71+
/* Driver Code */
72+
int main() {
73+
/* 配列を初期化 */
74+
int size = 5;
75+
int arr[5];
76+
printf("配列 arr = ");
77+
printArray(arr, size);
78+
79+
int nums[] = {1, 3, 2, 5, 4};
80+
printf("配列 nums = ");
81+
printArray(nums, size);
82+
83+
/* ランダムアクセス */
84+
int randomNum = randomAccess(nums, size);
85+
printf("nums からランダムな要素 %d を取得", randomNum);
86+
87+
/* 長さを拡張 */
88+
int enlarge = 3;
89+
int *res = extend(nums, size, enlarge);
90+
size += enlarge;
91+
printf("配列の長さを 8 に拡張し、nums = ");
92+
printArray(res, size);
93+
94+
/* 要素を挿入する */
95+
insert(res, size, 6, 3);
96+
printf("インデックス 3 に数字 6 を挿入し、nums = ");
97+
printArray(res, size);
98+
99+
/* 要素を削除 */
100+
removeItem(res, size, 2);
101+
printf("インデックス 2 の要素を削除し、nums = ");
102+
printArray(res, size);
103+
104+
/* 配列を走査 */
105+
traverse(res, size);
106+
107+
/* 要素を探索する */
108+
int index = find(res, size, 3);
109+
printf("res 内で要素 3 を検索し、インデックス = %d\n", index);
110+
111+
/* メモリを解放する */
112+
free(res);
113+
return 0;
114+
}

0 commit comments

Comments
 (0)