From 294eb3c53f3f8d13b7ce4cbd1ebcd90c9688d6f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=84=9C=EB=8B=A4=EC=86=94?= <30617570+dasol-seo@users.noreply.github.com> Date: Fri, 28 Jan 2022 05:04:41 +0900 Subject: [PATCH] Add merge sort document in Korean (#632) * Add merge sort doc in Korean * Update README.md --- .../sorting/merge-sort/README.ko-KR.md | 22 +++++++++++++++ src/algorithms/sorting/merge-sort/README.md | 27 ++++++++++--------- 2 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 src/algorithms/sorting/merge-sort/README.ko-KR.md diff --git a/src/algorithms/sorting/merge-sort/README.ko-KR.md b/src/algorithms/sorting/merge-sort/README.ko-KR.md new file mode 100644 index 00000000..5447fd21 --- /dev/null +++ b/src/algorithms/sorting/merge-sort/README.ko-KR.md @@ -0,0 +1,22 @@ +# 병합 정렬 + +컴퓨터과학에서, 병합 정렬(일반적으로 mergesort라고 쓰는)은 효율적이고, 범용적인, 비교 기반의 정렬 알고리즘입니다. 대부분의 구현들은 안정적인 정렬을 만들어내며, 이는 정렬된 산출물에서 동일한 요소들의 입력 순서가 유지된다는 것을 의미합니다. 병합 정렬은 1945년에 John von Neumann이 만든 분할 정복 알고리즘입니다. + +병합 정렬의 예시입니다. 우선 리스트를 가장 작은 단위로 나누고(한 개의 요소), 두 개의 인접한 리스트를 정렬하고 병합하기 위해 각 요소와 인접한 리스트를 비교합니다. 마지막으로 모든 요소들은 정렬되고 병합됩니다. + +![Merge Sort](https://upload.wikimedia.org/wikipedia/commons/c/cc/Merge-sort-example-300px.gif) + +재귀적인 병합 정렬 알고리즘은 7개의 정수값을 가진 배열을 정렬하는데 사용됩니다. 다음은 합병 정렬을 모방하기 위해 사람이 취하는 단계입니다.(하향식) + +![Merge Sort](https://upload.wikimedia.org/wikipedia/commons/e/e6/Merge_sort_algorithm_diagram.svg) + +## 복잡도 + +| Name | Best | Average | Worst | Memory | Stable | Comments | +| --------------------- | :-------------: | :-----------------: | :-----------------: | :-------: | :-------: | :-------- | +| **Merge sort** | n log(n) | n log(n) | n log(n) | n | Yes | | + +## 참조 + +- [Wikipedia](https://en.wikipedia.org/wiki/Merge_sort) +- [YouTube](https://www.youtube.com/watch?v=KF2j-9iSf4Q&index=27&list=PLLXdhg_r2hKA7DPDsunoDZ-Z769jWn4R8) diff --git a/src/algorithms/sorting/merge-sort/README.md b/src/algorithms/sorting/merge-sort/README.md index f4ed837a..b4d76b90 100644 --- a/src/algorithms/sorting/merge-sort/README.md +++ b/src/algorithms/sorting/merge-sort/README.md @@ -1,23 +1,26 @@ # Merge Sort -In computer science, merge sort (also commonly spelled -mergesort) is an efficient, general-purpose, -comparison-based sorting algorithm. Most implementations -produce a stable sort, which means that the implementation -preserves the input order of equal elements in the sorted -output. Mergesort is a divide and conquer algorithm that +_Read this in other languages:_ +[_한국어_](README.ko-KR.md) + +In computer science, merge sort (also commonly spelled +mergesort) is an efficient, general-purpose, +comparison-based sorting algorithm. Most implementations +produce a stable sort, which means that the implementation +preserves the input order of equal elements in the sorted +output. Mergesort is a divide and conquer algorithm that was invented by John von Neumann in 1945. -An example of merge sort. First divide the list into -the smallest unit (1 element), then compare each -element with the adjacent list to sort and merge the -two adjacent lists. Finally all the elements are sorted +An example of merge sort. First divide the list into +the smallest unit (1 element), then compare each +element with the adjacent list to sort and merge the +two adjacent lists. Finally all the elements are sorted and merged. ![Merge Sort](https://upload.wikimedia.org/wikipedia/commons/c/cc/Merge-sort-example-300px.gif) -A recursive merge sort algorithm used to sort an array of 7 -integer values. These are the steps a human would take to +A recursive merge sort algorithm used to sort an array of 7 +integer values. These are the steps a human would take to emulate merge sort (top-down). ![Merge Sort](https://upload.wikimedia.org/wikipedia/commons/e/e6/Merge_sort_algorithm_diagram.svg)