Skip to content
Merged
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ed93f3f
Recursion And Stack Translation
singularity-code Mar 28, 2019
a20af19
Recursion And Stack Translation Typo
singularity-code Apr 1, 2019
6b659f1
Rest Parameters & Spread Operator
singularity-code Apr 1, 2019
550c056
Closure Draft
Apr 1, 2019
5251354
Closure Draft
singularity-code Apr 1, 2019
d47170c
Var Draft
singularity-code Apr 1, 2019
1809cc1
Global Object Draft
singularity-code Apr 1, 2019
abd8877
Global Object Draft Fix
singularity-code Apr 1, 2019
d03b89b
Fix Recursion
singularity-code Apr 1, 2019
e00080b
#16 Typo
singularity-code Apr 2, 2019
c01f5d7
#16 Typo Closure
singularity-code Apr 4, 2019
c955709
#16 Recursion Tasks
singularity-code Apr 7, 2019
09fa774
#16 Closure Tasks
singularity-code Apr 7, 2019
558e713
#16 Old var
singularity-code Apr 7, 2019
5d4be69
#16 Function-Object and New Function
singularity-code Apr 7, 2019
cc3e557
#16 Typo 매개변수
singularity-code Apr 8, 2019
cf91c94
#16 Typo
singularity-code Apr 9, 2019
9a023a6
#16 Grammar - Recursion
singularity-code Apr 9, 2019
e10a291
#16 Grammar - Removing "We"
singularity-code Apr 9, 2019
2fad1a8
#16 Review - Recursion
singularity-code Apr 9, 2019
87a581d
#16 Review - Rest Parameters
singularity-code Apr 10, 2019
382bf28
#16 Review - Old Var
singularity-code Apr 10, 2019
382b48e
#16 Review - Global Obj
singularity-code Apr 10, 2019
e3183b0
#16 Review - Closure
singularity-code Apr 10, 2019
98a095c
#16 Review - Closure Tasks
singularity-code Apr 10, 2019
414c2cc
#16 직역수정
singularity-code Apr 11, 2019
c7ddd87
#16 직역수정
singularity-code Apr 11, 2019
1ef93dc
#16 Undo 6 & 7
singularity-code Apr 14, 2019
9e198fb
#16 Recusion 직역수정
singularity-code Apr 14, 2019
a890448
#16 Recursion Tasks 직역수정
singularity-code Apr 14, 2019
26dc200
#16 Recursion 직역수정
singularity-code Apr 15, 2019
a1ed9f3
#16 Rest Parameter 직역수정
singularity-code Apr 16, 2019
38f2ce1
Merge branch 'master' into master
Violet-Bora-Lee Apr 17, 2019
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
20 changes: 10 additions & 10 deletions 1-js/06-advanced-functions/01-recursion/01-sum-to/task.md
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ importance: 5

---

# Sum all numbers till the given one
# 주어진 숫자까지 모든 숫자를 합친다.

Write a function `sumTo(n)` that calculates the sum of numbers `1 + 2 + ... + n`.
숫자`1 + 2 + ... + n`의 합을 계산하는 함수`sumTo (n)`을 작성하십시오.

For instance:
예를들면:

```js no-beautify
sumTo(1) = 1
@@ -17,20 +17,20 @@ sumTo(4) = 4 + 3 + 2 + 1 = 10
sumTo(100) = 100 + 99 + ... + 2 + 1 = 5050
```

Make 3 solution variants:
3 가지 솔루션 변형 만들기 :

1. Using a for loop.
2. Using a recursion, cause `sumTo(n) = n + sumTo(n-1)` for `n > 1`.
3. Using the [arithmetic progression](https://en.wikipedia.org/wiki/Arithmetic_progression) formula.
1. for 루프 사용.
2. 재귀를 사용하면`n> 1`에 대해`sumTo (n) = n + sumTo (n-1)`이 됩니다.
3. [산술 진행](https://en.wikipedia.org/wiki/Arithmetic_progression) 공식사용.

An example of the result:
결과의 예 :

```js
function sumTo(n) { /*... your code ... */ }

alert( sumTo(100) ); // 5050
```

P.S. Which solution variant is the fastest? The slowest? Why?
P.S. 추신 어떤 솔루션 변형이 가장 빠릅니까? 가장 느린? 왜?

P.P.S. Can we use recursion to count `sumTo(100000)`?
P.P.S. 재귀를 사용하여`sumTo (100000)`을 계산할 수 있습니까?
12 changes: 6 additions & 6 deletions 1-js/06-advanced-functions/01-recursion/02-factorial/task.md
Original file line number Diff line number Diff line change
@@ -2,17 +2,17 @@ importance: 4

---

# Calculate factorial
# 계승 계산

The [factorial](https://en.wikipedia.org/wiki/Factorial) of a natural number is a number multiplied by `"number minus one"`, then by `"number minus two"`, and so on till `1`. The factorial of `n` is denoted as `n!`
자연수의 [계승](https://en.wikipedia.org/wiki/Factorial) (factorialial)은 숫자에 "1"을 곱한 다음 숫자를 2 "등으로 곱한 다음 1까지 계속됩니다. 'n'의 계승은`n! '으로 표시됩니다.

We can write a definition of factorial like this:
우리는 다음과 같은 계승의 정의를 쓸 수 있습니다 :

```js
n! = n * (n - 1) * (n - 2) * ...*1
```

Values of factorials for different `n`:
다른 'n'에 대한 계승 값 :

```js
1! = 1
@@ -22,10 +22,10 @@ Values of factorials for different `n`:
5! = 5 * 4 * 3 * 2 * 1 = 120
```

The task is to write a function `factorial(n)` that calculates `n!` using recursive calls.
이 작업은 재귀 호출을 사용하여`n! '을 계산하는`factorial (n)`함수를 작성하는 것입니다.

```js
alert( factorial(5) ); // 120
```

P.S. Hint: `n!` can be written as `n * (n-1)!` For instance: `3! = 3*2! = 3*2*1! = 6`
P.S. 힌트 :`n!``n * (n-1)! '로 쓸 수 있습니다! 예를 들면`3! = 3 * 2! = 3 * 2 * 1! = 6`
Original file line number Diff line number Diff line change
@@ -2,17 +2,18 @@ importance: 5

---

# Fibonacci numbers
# 피보나치 수

The sequence of [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number) has the formula <code>F<sub>n</sub> = F<sub>n-1</sub> + F<sub>n-2</sub></code>. In other words, the next number is a sum of the two preceding ones.
피보나치 수는 다음과 같은 공식을 가집니다 [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number)
<code>F<sub>n</sub> = F<sub>n-1</sub> + F<sub>n-2</sub></code>. 즉, 다음 숫자는 앞의 두 숫자의 합계입니다.

First two numbers are `1`, then `2(1+1)`, then `3(1+2)`, `5(2+3)` and so on: `1, 1, 2, 3, 5, 8, 13, 21...`.
처음 두 숫자는`1`,`2 (1 + 1)`,`3 (1 + 2)`,`5 (2 + 3)`등등입니다 :`1, 1, 2, 3, 5 , 8, 13, 21 ...`.

Fibonacci numbers are related to the [Golden ratio](https://en.wikipedia.org/wiki/Golden_ratio) and many natural phenomena around us.
피보나치 수는 [황금 비율](https://en.wikipedia.org/wiki/Golden_ratio)과 관련이 있습니다. 그리고 우리 주변의 많은 자연 현상.

Write a function `fib(n)` that returns the `n-th` Fibonacci number.
`n 번째 '피보나치 수를 반환하는 함수`fib (n)'을 작성하십시오.

An example of work:
:

```js
function fib(n) { /* your code */ }
@@ -22,4 +23,4 @@ alert(fib(7)); // 13
alert(fib(77)); // 5527939700884757
```

P.S. The function should be fast. The call to `fib(77)` should take no more than a fraction of a second.
P.S. 이 기능은 빠르다. `fib (77)`에 대한 호출은 1 초도 안된다.
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ importance: 5

---

# Output a single-linked list
# 단일 링크 목록 출력

Let's say we have a single-linked list (as described in the chapter <info:recursion>):
단일 연결 목록이 있다고 가정 해 봅니다 (<info:recursion>):

```js
let list = {
@@ -21,9 +21,8 @@ let list = {
}
};
```
목록 항목을 하나씩 출력하는`printList (list)`함수를 작성하십시오.

Write a function `printList(list)` that outputs list items one-by-one.
루프를 사용하고 재귀를 사용하여 솔루션의 두 가지 변형을 만듭니다.

Make two variants of the solution: using a loop and using recursion.

What's better: with recursion or without it?
무엇이 더 좋습니까? 재귀가 있거나 없으면 어떻게됩니까?
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ importance: 5

---

# Output a single-linked list in the reverse order
# 단일 링크 목록을 역순으로 출력

Output a single-linked list from the previous task <info:task/output-single-linked-list> in the reverse order.
이전 작업의 단일 연결 목록을 역순으로 출력합니다. <info:task/output-single-linked-list>

Make two solutions: using a loop and using a recursion.
루프를 사용하고 재귀를 사용하는 두 가지 솔루션을 만듭니다.
Loading