Skip to content

Commit dfffaa1

Browse files
authored
Merge pull request #77 from zgrcnltnk/patch-3
recursion jargonu eklendi
2 parents 4b3f020 + 4c59a2a commit dfffaa1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

jargons/recursion.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: recursion
3+
sameWith:
4+
- recursive
5+
tags:
6+
- genel
7+
---
8+
9+
Bir problemin çözümünü elde etmek için kendini tekrarlayan metodu tanımlama şeklidir. [Bu](/recursion) sayfa [recursion](/recursion)'a örnek gösterilebilir.
10+
11+
```js
12+
function fibonacci(x) {
13+
if (x <= 1) {
14+
return 1;
15+
};
16+
17+
// Burada recursive olarak fibonacci fonksiyonunu tekrar çağırıyoruz.
18+
return fibonacci(x - 1) + fibonacci(x - 2);
19+
}
20+
21+
const result = fibonacci(8);
22+
console.log(result); // Output: 34
23+
```

0 commit comments

Comments
 (0)