Skip to content

Added Korean translation #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1054184
added korean directory
Aug 25, 2021
0e1d20a
added fibonacci numbers in ko basic math
Aug 25, 2021
6660da6
added geometric sequence in ko basic math
Aug 25, 2021
a4e03af
revised geometric sequence
Aug 25, 2021
f07b360
added arithmetic sequence in ko basic math
Aug 25, 2021
1dde80f
added average in ko basic math
Aug 25, 2021
cd26eb9
added maximum number and revised ko basic math
Aug 25, 2021
ba0681c
added array and revised ko basic math
Aug 27, 2021
d6f5d74
added Bellman-Ford in ko data structure
Aug 27, 2021
2899c1c
Merge branch 'TheAlgorithms:master' into master
Aug 28, 2021
c37595e
Merge branch 'TheAlgorithms:master' into master
Sep 4, 2021
6d6ef40
Merge branch 'TheAlgorithms:master' into master
Sep 12, 2021
3943879
Merge branch 'TheAlgorithms:master' into master
Sep 17, 2021
9fbecb7
Merge branch 'TheAlgorithms:master' into master
Oct 5, 2021
066faf8
Add singly linked list in ko data structure
Oct 5, 2021
714563d
Add doubly linked list in ko data structure
Oct 5, 2021
6b34bfc
Revise ko data structure
Oct 6, 2021
2d306ae
Add ko binary search and revise previous works
Oct 6, 2021
7e4913c
Complete searching algorithms
Oct 6, 2021
b433763
Make latex visible on github
Oct 6, 2021
6c7bac5
Start working on ko sorting algorithms
Oct 11, 2021
df40544
Merge branch 'master' of https://github.com/TheAlgorithms/Algorithms-…
Oct 11, 2021
408f468
Commit to merge with master
Oct 11, 2021
1b6b90e
Merge pull request #2 from JoonhunLee/TheAlgorithms-master
Oct 11, 2021
ee523f2
Merge branch 'TheAlgorithms:master' into master
Oct 13, 2021
ef1cd6b
Merge branch 'TheAlgorithms:master' into master
Nov 7, 2021
c247040
Merge branch 'TheAlgorithms:master' into master
Dec 1, 2021
795d7ff
Merge branch 'TheAlgorithms:master' into master
Dec 26, 2021
93752f6
Merge branch 'TheAlgorithms:master' into master
Feb 2, 2022
04664f9
Merge branch 'TheAlgorithms:master' into master
Jun 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions en/Data Structures/Graph/Bellman-Ford.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Given a weighted directed graph G(V,E) and a source vertex s ∈ V, determine fo
- Create an array dist[] of size |V| with all values as infinite except dist[s].
- Repeat the following |V| - 1 times. Where |V| is number of vertices.
- Create another loop to go through each edge (u, v) in E and do the following:
1. dist[v] = minimum(dist[v], dist[u] + weight of edge).
1. dist[v] = minimum(dist[v], dist[u] + weight of edge).
- Lastly iterate through all edges on last time to make sure there are no negatively weighted cycles.

#### Time Complexity
Expand All @@ -30,52 +30,52 @@ O(V^2)

```
# of vertices in graph = 5 [A, B, C, D, E]
# of edges in graph = 8
# of edges in graph = 8

edges [A->B, A->C, B->C, B->D, B->E, D->C, D->B, E->D]
weight [ -1, 4, 3, 2, 2, 5, 1, -4 ]
source [ A, A, B, B, B, D, D, E ]



// edge A->B
graph->edge[0].src = A
graph->edge[0].dest = B
graph->edge[0].weight = -1
// edge A->C
graph->edge[1].src = A
graph->edge[1].dest = C
graph->edge[1].weight = 4
// edge B->C
graph->edge[2].src = B
graph->edge[2].dest = C
graph->edge[2].weight = 3
// edge B->D
graph->edge[3].src = B
graph->edge[3].dest = D
graph->edge[3].weight = 2
// edge B->E
graph->edge[4].src = B
graph->edge[4].dest = E
graph->edge[4].weight = 2
// edge D->C
// edge A->B
graph->edge[0].src = A
graph->edge[0].dest = B
graph->edge[0].weight = -1

// edge A->C
graph->edge[1].src = A
graph->edge[1].dest = C
graph->edge[1].weight = 4

// edge B->C
graph->edge[2].src = B
graph->edge[2].dest = C
graph->edge[2].weight = 3

// edge B->D
graph->edge[3].src = B
graph->edge[3].dest = D
graph->edge[3].weight = 2

// edge B->E
graph->edge[4].src = B
graph->edge[4].dest = E
graph->edge[4].weight = 2

// edge D->C
graph->edge[5].src = D
graph->edge[5].dest = C
graph->edge[5].weight = 5
// edge D->B
graph->edge[5].dest = C
graph->edge[5].weight = 5

// edge D->B
graph->edge[6].src = D
graph->edge[6].dest = B
graph->edge[6].weight = 1
// edge E->D
graph->edge[6].dest = B
graph->edge[6].weight = 1

// edge E->D
graph->edge[7].src = E
graph->edge[7].dest = D
graph->edge[7].dest = D
graph->edge[7].weight = -3

for source = A
Expand All @@ -86,8 +86,7 @@ O(V^2)
C 2 A->B->C = -1 + 3
D -2 A->B->E->D = -1 + 2 + -3
E 1 A->B->E = -1 + 2
```

```

#### Code Implementation Links

Expand All @@ -103,5 +102,6 @@ O(V^2)
#### Others

Sources Used:

- https://www.geeksforgeeks.org/bellman-ford-algorithm-dp-23/
- https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
12 changes: 5 additions & 7 deletions ko/기초 수학/등비수열.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

**등비수열의 n번째 항 공식:**

`a`가 초항이고, `r`이 공비일 때, n번째 항은:
<img src="https://render.githubusercontent.com/render/math?math=a">가 초항, <img src="https://render.githubusercontent.com/render/math?math=r">이 공비일 때, <img src="https://render.githubusercontent.com/render/math?math=n">번째 항은:

<p align="center">
<img width="60%" src="https://user-images.githubusercontent.com/75872316/122635586-6fc12200-d102-11eb-9a87-333c9a578cc8.png">
Expand All @@ -37,13 +37,11 @@

**등비수열에 관련된 문제를 풀기 위한 일반적인 공식:**

`a`가 초항, `r`이 공비일 때:
<img src="https://render.githubusercontent.com/render/math?math=a">가 초항, <img src="https://render.githubusercontent.com/render/math?math=r">이 공비일 때:

- 등비수열의 n번째 항 = `a * r^(n-1)`.
- 기하평균 = `n개 항의 곱의 n제곱근`.
- 등비급수 (r < 1) = `[a (1 – r^n)] / [1 – r]`.
- 등비급수 (r > 1) = `[a (r^n – 1)] / [r – 1]`.
- 무한등비급수 (r < 1) = `(a) / (1 – r)`.
- 등비급수 (r < 1) = <img src="https://render.githubusercontent.com/render/math?math=\frac{a(1-r^n)}{1-r}">
- 등비급수 (r > 1) = <img src="https://render.githubusercontent.com/render/math?math=\frac{a(r^n-1)}{r-1}">
- 무한등비급수 (r < 1) = <img src="https://render.githubusercontent.com/render/math?math=\frac{a}{1-r}">

## 영상 URL

Expand Down
9 changes: 4 additions & 5 deletions ko/기초 수학/등차수열.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

**등차수열의 n번째 항 공식:**

`a`가 초항이고, `d`가 공차일 때, n번째 항은:
<img src="https://render.githubusercontent.com/render/math?math=a">가 초항, <img src="https://render.githubusercontent.com/render/math?math=d">가 공차일 때, <img src="https://render.githubusercontent.com/render/math?math=n">번째 항은:

<p align="center">
<img width="60%" src="https://user-images.githubusercontent.com/75872316/122635193-25d73c80-d100-11eb-9015-344d36633704.png">
Expand All @@ -30,11 +30,10 @@

**등차수열에 관련된 물제를 풀기 위한 일반적인 공식:**

`a`가 초항, `d`가 공차일 때:
<img src="https://render.githubusercontent.com/render/math?math=a">가 초항, <img src="https://render.githubusercontent.com/render/math?math=d">가 공차일 때:

- 등차수열의 n번째 항 = `a + d*(n-1)`.
- 산술평균 = `전체 항의 합 / 항의 개수`.
- 등차급수 = `0.5 * n * (초항 + 말항)` = `0.5 * n * [2a + (n-1) d]`.
- 산술평균 = `전체 항의 합 / 항의 개수`
- 등차급수 = `n * (초항 + 말항) / 2` = <img src="https://render.githubusercontent.com/render/math?math=\frac{n \cdot (2a %2b (n-1)d)}{2}">

## 영상 URL

Expand Down
2 changes: 1 addition & 1 deletion ko/기초 수학/자릿수.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ N = 10000 [양수]
3. N을 10으로 나눈다.
4. N이 0이 될 때까지 위의 과정을 반복한다.

**알고리즘 분석:** 위 방법에서 수행되는 작업의 수는 숫자 N의 자릿수와 같다는 사실을 쉽게 알 수 있다. 따라서 이 방법의 시간 복잡도는 $O(자릿수)$이다.
**알고리즘 분석:** 위 방법에서 수행되는 작업의 수는 숫자 N의 자릿수와 같다는 사실을 쉽게 알 수 있다. 따라서 이 방법의 시간 복잡도는 <img src="https://render.githubusercontent.com/render/math?math=O(d)">이다. (<img src="https://render.githubusercontent.com/render/math?math=d">는 숫자 N의 자릿수)

**모의 실행:** `N = 58964`라고 할 때,

Expand Down
6 changes: 3 additions & 3 deletions ko/기초 수학/평균값.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ sum = 160
count = 7
```

유효숫자를 무시하면: `sum / count = `22.<u>857142</u>
유효숫자를 무시하면 22.<u>857142</u>

유효숫자를 고려하면: `sum / count = 23`
유효숫자를 고려하면 23

### 5단계

22.<u>857142</u>나 `23`을 반환한다.
22.<u>857142</u>나 23을 반환한다.

## 구현

Expand Down
21 changes: 10 additions & 11 deletions ko/자료구조/그래프/벨먼-포드 알고리즘.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## 문제

방향 가중치 그래프 $G(V,E)$와 시작점 $s \in V$가 주어졌을 때, 각 점 $v \in V$에 대하여 $s$와 $v$를 잇는 가장 짧은 경로를 구하라. ($V$는 꼭짓점의 집합, $E$는 간선의 집합)
방향 가중치 그래프 <img src="https://render.githubusercontent.com/render/math?math=G(V,E)">와 시작점 <img src="https://render.githubusercontent.com/render/math?math=s \in V">가 주어졌을 때, 각 점 <img src="https://render.githubusercontent.com/render/math?math=v \in V">에 대하여 <img src="https://render.githubusercontent.com/render/math?math=s">와 <img src="https://render.githubusercontent.com/render/math?math=v">를 잇는 가장 짧은 경로를 구하라. (<img src="https://render.githubusercontent.com/render/math?math=V">는 꼭짓점의 집합, <img src="https://render.githubusercontent.com/render/math?math=E">는 간선의 집합)

## 절차

1. 시작점에서 모든 꼭짓점까지의 거리를 무한대로 초기화한다.
2. 시작점으로의 거리를 0으로 초기화한다.
3. `dist[s]`를 제외한 모든 값을 무한대로 하는 크기가 $|V|$인 `dist`라는 배열을 만든다.
4. 다음을 $|V|-1$회 반복한다.
5. $E$에 속한 모든 간선 `(u,v)`에 대해 다음을 반복한다:
3. `dist[s]`를 제외한 모든 값을 무한대로 하는 크기가 <img src="https://render.githubusercontent.com/render/math?math=|V|">인 `dist`라는 배열을 만든다.
4. 다음을 <img src="https://render.githubusercontent.com/render/math?math=|V|-1">회 반복한다.
5. <img src="https://render.githubusercontent.com/render/math?math=E">에 속한 모든 간선 `(u,v)`에 대해 다음을 반복한다:

```
dist[v] = minimum(dist[v], dist[u] + weight of edge)
Expand All @@ -20,11 +20,11 @@

## 시간 복잡도

$O(VE)$
<img src="https://render.githubusercontent.com/render/math?math=O(VE)">

## 공간 복잡도

$O(V^2)$
<img src="https://render.githubusercontent.com/render/math?math=O(V^2)">

## 만든 사람

Expand All @@ -41,7 +41,6 @@ $O(V^2)$
시작점: [ A, A, B, B, B, D, D, E ]



꼭짓점 개수 = 5
간선 개수 = 8

Expand Down Expand Up @@ -87,7 +86,7 @@ $O(V^2)$

for source = A

Vertex Distance from Source
꼭짓점 시작점으로부터의 거리
A 0 (A->A)
B -1 (A->B)
C 2 (A->B->C = -1 + 3)
Expand All @@ -98,9 +97,9 @@ $O(V^2)$
## 구현

- [Java](https://github.com/TheAlgorithms/Java/blob/master/DataStructures/Graphs/BellmanFord.java)
- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/Dynamic%20Programming/Bellman-Ford.cpp)
- [Python](https://github.com/TheAlgorithms/Python/blob/master/data_structures/graph/bellman_ford.py)
- [C](https://github.com/TheAlgorithms/C/blob/master/data_structures/graphs/Bellman-Ford.c)
- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/dynamic_programming/bellman_ford.cpp)
- [Python](https://github.com/TheAlgorithms/Python/blob/master/graphs/bellman_ford.py)
- [C](https://github.com/TheAlgorithms/C/blob/master/data_structures/graphs/bellman_ford.c)

## 영상 URL

Expand Down
9 changes: 3 additions & 6 deletions ko/자료구조/배열/배열.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

배열은 프로그래밍에서 가장 기본적인 데이터 구조이다. 배열은 정적 배열과 동적 배열로 나눠진다. 정적 배열은 요소의 수가 고정되어 있고, 각각은 메모리의 동일한 공간을 차지한다. 즉, 정적 배열이 차지하는 메모리는 컴파일 시간에 결정되지만, 동적 배열의 경우 크기가 고정되지 않는다.

배열 요소의 값은 `O(1)` 시간 안에 검색할 수 있다.
배열 요소의 값은 <img src="https://render.githubusercontent.com/render/math?math=O(1)"> 시간 안에 검색할 수 있다.

모든 배열은 연속된 메모리 주소를 가진다. 우리는 인덱스로 각 요소에 접근할 수 있다.
가장 낮은 인덱스는 첫 요소에 해당하고 가장 높은 인덱스는 마지막 요소에 해당한다.

## YouTube

- [The Coding Train](https://youtu.be/NptnmWvkbTw)
- [Simple Snippets (C++)](https://youtu.be/ibeGtDEQGz0)

## 영상 URL

- [GeeksforGeeks](https://www.geeksforgeeks.org/introduction-to-arrays/)
- [The Coding Train](https://youtu.be/NptnmWvkbTw)
- [Simple Snippets (C++)](https://youtu.be/ibeGtDEQGz0)
23 changes: 12 additions & 11 deletions ko/자료구조/연결 리스트/단일 연결 리스트.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,26 @@

### 시간 복잡도

| 작업 | 평균 | 최악 |
| ---- | ------ | ------ |
| 접근 | $O(n)$ | $O(n)$ |
| 탐색 | $O(n)$ | $O(n)$ |
| 삽입 | $O(1)$ | $O(1)$ |
| 제거 | $O(1)$ | $O(1)$ |
| 작업 | 평균 | 최악 |
| ---- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| 접근 | <img src="https://render.githubusercontent.com/render/math?math=O(n)"> | <img src="https://render.githubusercontent.com/render/math?math=O(n)"> |
| 탐색 | <img src="https://render.githubusercontent.com/render/math?math=O(n)"> | <img src="https://render.githubusercontent.com/render/math?math=O(n)"> |
| 삽입 | <img src="https://render.githubusercontent.com/render/math?math=O(1)"> | <img src="https://render.githubusercontent.com/render/math?math=O(1)"> |
| 제거 | <img src="https://render.githubusercontent.com/render/math?math=O(1)"> | <img src="https://render.githubusercontent.com/render/math?math=O(1)"> |

## 예시

```java
class LinkedList {
Node head; // Pointer to the first element
Node tail; // Optional. Points to the last element
<<<<<<< HEAD
Node head; // 첫 원소를 가리키는 포인터
Node tail; // (Optional) 마지막 원소를 가리키는 포인터

int length; // Optional
int length; // (Optional) 전체 노드 수

class Node {
int data; // Node data. Can be int, string, float, templates, etc
Node next; // Pointer to the next node on the list
int data; // 노드의 데이터
Node next; // 다음 노드를 가리키는 포인터
}
}
```
Expand Down
Loading