8000 Merge duplicated Korean translations (#194) (#197) · Surani02/Algorithms-Explanation@15028db · GitHub
[go: up one dir, main page]

Skip to content

Commit 15028db

Browse files
authored
Merge duplicated Korean translations (TheAlgorithms#194) (TheAlgorithms#197)
* merge duplicated explanations * formatting
1 parent 79ca83c commit 15028db

File tree

11 files changed

+112
-448
lines changed

11 files changed

+112
-448
lines changed

ko/정렬 알고리즘/버블 정렬.md

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,100 @@
22

33
## 문제
44

5-
n개 원소로 구성된 배열이 주어졌을 때, 배열을 정렬하는 함수를 구하라.
5+
원소 n개로 이루어진 정렬되지 않은 배열이 주어졌을 때, 배열을 정렬하는 함수를 작성하라.
66

7-
## 절차
7+
## 접근방식
88

9-
- select the first element of the array
10-
- compare it with its next element
11-
- if it is larger than the next element then swap them
12-
- else do nothing
13-
- keep doing this for every index of the array
14-
- repeat the above process n times.
9+
- 배열의 첫 번째 원소를 선택한다.
10+
- 다음 원소와 비교한다.
11+
- 다음 원소보다 크다면 교환한다.
12+
- 아니라면 아무것도 하지 않는다.
13+
- 배열의 모든 인덱스에 이 작업을 진행한다.
14+
- 위의 과정을 n번 반복한다.
1515

1616
## 시간 복잡도
1717

18-
- 최악: <img src="https://render.githubusercontent.com/render/math?math=O(n^2)">
19-
- 최선: <img src="https://render.githubusercontent.com/render/math?math=O(n)">
20-
- 평균: <img src="https://render.githubusercontent.com/render/math?math=O(n^2)">
18+
$O(n^2)$ 최악의 경우
19+
20+
$O(n)$ 최선의 경우
21+
22+
$O(n^2)$ 평균 복잡도
2123

2224
## 공간 복잡도
2325

24-
- 최악: <img src="https://render.githubusercontent.com/render/math?math=O(1)">
26+
$O(1)$ 최악의 경우
2527

2628
## 만든 사람
2729

28-
- [케네스 아이버슨](https://ko.wikipedia.org/wiki/%EC%BC%80%EB%84%A4%EC%8A%A4_%EC%95%84%EC%9D%B4%EB%B2%84%EC%8A%A8): "버블 정렬"이라는 용어를 1962년에 처음으로 사용했다.
30+
- “Bubble Sort”라는 용어는 1962년 Iverson, K에 의해 처음 사용되었다.
2931

3032
## 예시
3133

3234
```
33-
arr[] = {10, 80, 40, 30}
34-
Indexes: 0 1 2 3
35+
배열 = {10, 80, 40, 30}
36+
인덱스들: 0 1 2 3
3537
36-
1. Index = 0, Number = 10
37-
2. 10 < 80, do nothing and continue
38+
1. 인덱스 = 0, 숫자 = 10
39+
2. 10 < 80, 아무것도 하지 않고 다음 단계로 넘어간다.
3840
39-
3. Index = 1, Number = 80
40-
4. 80 > 40, swap 80 and 40
41-
5. The array now is {10, 40, 80, 30}
41+
3. 인덱스 = 1, 숫자 = 80
42+
4. 80 > 40, 80과 40을 교환한다.
43+
5. 현재 배열은 {10, 40, 80, 30}
4244
43-
6. Index = 2, Number = 80
44-
7. 80 > 30, swap 80 and 30
45-
8. The array now is {10, 40, 30, 80}
45+
6. 인덱스 = 2, 숫자 = 80
46+
7. 80 > 30, 80과 30을 교환한다.
47+
8. 현재 배열은 {10, 40, 30, 80}
4648
47-
Repeat the Above Steps again
49+
위 단계를 다시 반복한다.
4850
49-
arr[] = {10, 40, 30, 80}
50-
Indexes: 0 1 2 3
51+
배열 = {10, 40, 30, 80}
52+
인덱스들: 0 1 2 3
5153
52-
1. Index = 0, Number = 10
53-
2. 10 < 40, do nothing and continue
54+
1. 인덱스 = 0, 숫자 = 10
55+
2. 10 < 40, 아무것도 하지 않고 다음 단계로 넘어간다.
5456
55-
3. Index = 1, Number = 40
56-
4. 40 > 30, swap 40 and 30
57-
5. The array now is {10, 30, 40, 80}
57+
3. 인덱스 = 1, 숫자 = 40
58+
4. 40 > 30, 40과 30을 교환한다.
59+
5. 현재 배열은 {10, 30, 40, 80}
5860
59-
6. Index = 2, Number = 40
60-
7. 40 < 80, do nothing
61-
8. The array now is {10, 30, 40, 80}
61+
6. 인덱스 = 2, 숫자 = 40
62+
7. 40 < 80, 아무것도 하지 않는다.
63+
8. 현재 배열은 {10, 30, 40, 80}
6264
63-
Repeat the Above Steps again
65+
위 단계를 다시 반복한다.
6466
65-
arr[] = {10, 30, 40, 80}
66-
Indexes: 0 1 2 3
67+
배열 = {10, 30, 40, 80}
68+
인덱스들: 0 1 2 3
6769
68-
1. Index = 0, Number = 10
69-
2. 10 < 30, do nothing and continue
70+
1. 인덱스 = 0, 숫자 = 10
71+
2. 10 < 30, 아무것도 하지 않고 다음 단계로 넘어간다.
7072
71-
3. Index = 1, Number = 30
72-
4. 30 < 40, do nothing and continue
73+
3. 인덱스 = 1, 숫자 = 30
74+
4. 30 < 40, 아무것도 하지 않고 다음 단계로 넘어간다.
7375
74-
5. Index = 2, Number = 40
75-
6. 40 < 80, do nothing
76+
5. 인덱스 = 2, 숫자 = 40
77+
6. 40 < 80, 아무것도 하지 않는다.
7678
77-
Since there are no swaps in above steps, it means the array is sorted and we can stop here.
79+
위 단계에서 교환이 없기 때문에 배열이 정렬되었음을 의미하고, 여기서 멈출 수 있다.
7880
```
7981

8082
## 구현
8183

82-
- [Java](https://github.com/TheAlgorithms/Java/blob/master/Sorts/BubbleSort.java)
84+
- [자바](https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/sorts/BubbleSort.java)
8385
- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/sorting/bubble_sort.cpp)
84-
- [Python](https://github.com/TheAlgorithms/Python/blob/master/sorts/bubble_sort.py)
86+
- [파이썬](https://github.com/TheAlgorithms/Python/blob/master/sorts/bubble_sort.py)
8587
- [C#](https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Sorters/Comparison/BubbleSorter.cs)
86-
- [Go](https://github.com/TheAlgorithms/Go/blob/master/sorts/bubblesort.go)
87-
- [Ruby](https://github.com/TheAlgorithms/Ruby/blob/master/sorting/bubble_sort.rb)
88+
- [](https://github.com/TheAlgorithms/Go/blob/master/sorts/bubblesort.go)
89+
- [루비](https://github.com/TheAlgorithms/Ruby/blob/master/sorting/bubble_sort.rb)
8890
- [C](https://github.com/TheAlgorithms/C/blob/master/sorting/bubble_sort.c)
89-
- [Scala](https://github.com/TheAlgorithms/Scala/blob/master/src/main/scala/Sort/BubbleSort.scala)
90-
- [JavaScript](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/BubbleSort.js)
91+
- [스칼라](https://github.com/TheAlgorithms/Scala/blob/master/src/main/scala/Sort/BubbleSort.scala)
92+
- [자바스크립트](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/BubbleSort.js)
9193

9294
## 영상 URL
9395

94-
- [mycodeschool](https://www.youtube.com/watch?v=Jdtq5uKz-w4)
96+
- [버블정렬 알고리즘에 대한 영상 설명](https://www.youtube.com/watch?v=Jdtq5uKz-w4)
9597

9698
## 기타
9799

98-
- [Tute Board](https://boardhub.github.io/tute/?wd=bubbleSortAlgo2)
100+
- 버블 정렬은 싱킹 정렬이라고도 한다.
101+
- 시각화: [튜트 보드](https://boardhub.github.io/tute/?wd=bubbleSortAlgo2)

ko/정렬 알고리즘/힙 정렬.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,68 @@
22

33
## 문제
44

5-
n개 원소로 구성된 배열이 주어졌을 때, 배열을 정렬하는 함수를 구하라.
5+
정렬되지 않은 n개의 원소로 이루어진 배열이 주어졌을 때, 배열을 정렬하는 함수를 작성하라
66

7-
## 절차
7+
## 접근방식
88

9-
- Build a max heap from the input data.
10-
- At this point, the largest item is stored at the root of the heap. Replace it with the last item of the heap followed by reducing the size of heap by 1. Finally, heapify the root of tree.
11-
- Repeat above steps while size of heap is greater than 1.
9+
- 입력 데이터에서 최대 힙을 빌드한다.
10+
- 이때, 가장 큰 원소가 힙의 루트에 저장된다. 해당 원소를 힙의 마지막 원소로 교체한 뒤, 힙의 사이즈를 1 줄인다.
11+
- 힙의 사이즈가 1보다 크다면 위 과정을 반복한다.
1212

1313
## 시간 복잡도
1414

15-
- 최악: <img src="https://render.githubusercontent.com/render/math?math=O(n \log n)">
16-
- 최선:
17-
distinct keys일 때 <img src="https://render.githubusercontent.com/render/math?math=O(n \log n)">,
18-
equal keys일 때 <img src="https://render.githubusercontent.com/render/math?math=O(n)">
19-
- 평균: <img src="https://render.githubusercontent.com/render/math?math=O(n \log n)">
15+
$O(n log n)$ 최악의 경우
16+
17+
$O(n log n)$ (고유 키)
18+
or O(n) (동일 키) 최선의 경우
19+
20+
$O(n log n)$ 평균 복잡도
2021

2122
## 공간 복잡도
2223

23-
- 최악: <img src="https://render.githubusercontent.com/render/math?math=O(1)">
24+
$O(1)$ 최악의 경우
2425

2526
## 예시
2627

2728
```
28-
Input data: 4, 10, 3, 5, 1
29+
입력 원소 : 4, 10, 3, 5, 1
2930
4(0)
3031
/ \
3132
10(1) 3(2)
3233
/ \
3334
5(3) 1(4)
3435
35-
The numbers in bracket represent the indices in the array
36-
representation of data.
36+
괄호 안의 숫자는 데이터의 배열 인덱스를 나타낸다.
3737
38-
Applying heapify procedure to index 1:
38+
1번 인덱스에 힙 절차 적용 :
3939
4(0)
4040
/ \
4141
10(1) 3(2)
4242
/ \
4343
5(3) 1(4)
4444
45-
Applying heapify procedure to index 0:
45+
0번 인덱스의 힙 절차 적용:
4646
10(0)
4747
/ \
4848
5(1) 3(2)
4949
/ \
5050
4(3) 1(4)
51-
The heapify procedure calls itself recursively to build heap
52-
in top down manner.
51+
힙 절차는 재귀적으로 호출하여 하향식 방식으로 힙을 빌드한다.
5352
```
5453

55-
![heap-image](https://upload.wikimedia.org/wikipedia/commons/1/1b/Sorting_heapsort_anim.gif 'Heap Sort')
54+
![힙 이미지](https://upload.wikimedia.org/wikipedia/commons/1/1b/Sorting_heapsort_anim.gif)
5655

5756
## 구현
5857

59-
- [Java](https://github.com/TheAlgorithms/Java/blob/master/Sorts/HeapSort.java)
58+
- [자바](https://github.com/TheAlgorithms/Java/blob/master/src/main/java/com/thealgorithms/sorts/HeapSort.java)
6059
- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/sorting/heap_sort.cpp)
61-
- [Python](https://github.com/TheAlgorithms/Python/blob/master/sorts/heap_sort.py)
62-
- [Go](https://github.com/TheAlgorithms/Go/blob/master/sorts/heapsort.go)
63-
- [Ruby](https://github.com/TheAlgorithms/Ruby/blob/master/sorting/heap_sort.rb)
64-
- [C#](https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Sorters/Comparison/HeapSorter.cs)
60+
- [파이썬](https://github.com/TheAlgorithms/Python/blob/master/sorts/heap_sort.py)
61+
- [](https://github.com/TheAlgorithms/Go/blob/master/sorts/heapsort.go)
62+
- [루비](https://github.com/TheAlgorithms/Ruby/blob/master/sorting/heap_sort.rb)
63+
- [C-sharp](https://github.com/TheAlgorithms/C-Sharp/blob/master/Algorithms/Sorters/Comparison/HeapSorter.cs)
6564
- [C](https://github.com/TheAlgorithms/C/blob/master/sorting/heap_sort.c)
66-
- [JavaScript](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/HeapSort.js)
65+
- [자바스크립트](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/HeapSort.js)
6766

6867
## 영상 URL
6968

70-
[GeeksforGeeks](https://www.youtube.com/watch?v=MtQL_ll5KhQ)
69+
[힙 정렬 알고리즘에 대한 영상 설명](https://www.youtube.com/watch?v=MtQL_ll5KhQ)

ko/정렬/버블정렬.md

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

0 commit comments

Comments
 (0)
0