Skip to content

Korean translation #157

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 7 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions ko/자료구조/연결 리스트/원형 연결 리스트.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

### SLL v.s. CLL

![image](https://i0.wp.com/algorithms.tutorialhorizon.com/files/2016/03/Circular-Linked-List.png)
![영상](https://i0.wp.com/algorithms.tutorialhorizon.com/files/2016/03/Circular-Linked-List.png)

### 예시

Expand Down Expand Up @@ -72,4 +72,4 @@ public void insertHead(int data)

## 영상 URL

[Video explanation on YouTube](https://youtu.be/HMkdlu5sP4A)
[유투브 영상](https://youtu.be/HMkdlu5sP4A)
39 changes: 39 additions & 0 deletions ko/탐색/플로이드 순환 탐색 알고리즘.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 배열에서 중복 번호를 찾는 플로이드 순환 탐색 알고리즘

## 문제

`n + 1` 정수를 포함하는 정수 배열이 주어지면 각 정수는 `[1, n]`을 포함한 범위에 있다. 입력 배열에 중복 숫자가 하나만 있으면 이 알고리즘은 원래 배열을 수정하지 않고 중복 숫자를 반환하고, 그렇지 않으면 `-1`을 반환한다.

## 접근 방식


- 함수 `f(x) = arr[x]`를 사용하여 시퀀스를 구성한다.
<예시> `arr[0]`, `arr[arr[0]]`, `arr[arr[arr[0]]]`, `arr[arr[arr[arr[0]]]]`
- 시퀀스의 각각의 새로운 원소는 이전 요소의 인덱스에 있는 `arr[]`의 원소입니다.
- `x = arr[0]`부터 시작하여 원형 연결 리스트를 생성한다.
- `arr[]`에 중복 원소(최소 하나)가 포함되어 있기 때문에 `cycle`이 나타난다. 중복 값은 순환의 시작점이다.

## 시간 복잡도

O(n)

## 공간 복잡도

O(1)

## 예시

```
arr = [3, 4, 8, 5, 9, 1, 2, 6, 7, 4]

return value = 4
```

## 구현

- [C++](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/search/floyd_cycle_detection_algo.cpp)
- [C](https://github.com/TheAlgorithms/C/blob/master/searching/floyd_cycle_detection_algorithm.c)

#### 영상 URL

[플로이드 순환 탐색 알고리즘 유투브 영상](https://www.youtube.com/watch?v=B6smdk7pZ14)