# recursion

recursion_basic. 피보나치 수열 1
피보나치 수열피보나치 수열은 처음에는 0두번째 열에는 1세번째 열부터는 첫번째 열과 두번째 열을 더한 값네번째 열에서 두번째 열과 세번째 열을 더한 값을 나열하는수열이다.자바 코드로 이 수열을 구현하면 다음과 같다.if문으로 감싸서num이 1이면 0;num이 2이면 1

[CodeSignal] Arcade - Smooth Sailing(14) reverseInParentheses
Write a function that reverses characters in (possibly nested) parentheses in the input string. Input strings will always be well-formed with matching
[Leetcode]332. Reconstruct Itinerary
Referenceshttps://leetcode.com/problems/reconstruct-itinerary/
(Javascript) 재귀(recursion)와 메모이제이션(Memoization) (1)
재귀란 함수가 자기 자신을 호출 하는 것을 의미합니다. 간단하게 팩토리얼(!) 을 알려주는 함수를 만들어보겠습니다.위에 코드도 맞는 코드지만 우아하지도 않고 확장가능성도 없습니다 . 재귀를 사용해서 코드를 만들어보겠습니다 .factorial 함수를 만들었는데 그 안에

백준 / 조합 / 2407
Question문제링크Silver 3Logic기본 구조 : recursion1\. nCm의 계산식은 다음과 같다.각각을 for문 으로 길게 작성하는 것보다 함수를 활용하는 편이 좋다.팩토리얼 계산문을 재귀함수로 작성한다.이 때, 나누기 연산'/'는 큰 실수 함수로 계산

백준 / 하노이 탑 이동순서 / 11729
Question문제링크Silver 1Logic기본 구조 : recursion하노이 탑은 다음과 같다.시작 지점 1을 s, 목적지 3을 d, 중간지점 2를 t라 한다.3-1. N=2일때, 두번 째 디스크를 3으로 보내려면 우선 첫번 째 디스크를 2로 보내야 한다. (1

백준 / 곱셈 / 1629
Question문제링크Silver 1자연수 A를 B번 곱한 수를 알고 싶다. 단 구하려는 수가 매우 커질 수 있으므로 이를 C로 나눈 나머지를 구하는 프로그램을 작성하시오.Input첫째 줄에 A, B, C가 빈 칸을 사이에 두고 순서대로 주어진다. A, B, C는 모두

[Leetcode]112. Path Sum
Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the

[Leetcode]101. Symmetric Tree
📄 Description Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).

[백준 5904 - Kotlin] Moo 게임
문제링크n의 위치가 S(i)에 존재한다고 가정해봅시다.S(i)는 S(i - 1) + mooo... + S(i - 1) 을 의미하고, n의 위치가 S(i)에 존재한다는 것은 S(i - 1)에는 존재하지 않다는 것을 의미합니다.따라서 S(i)에 존재한다는 것을 알게되었을

[Leetcode]100. Same Tree
Given the roots of two binary trees p and q, write a function to check if they are the same or not.Two binary trees are considered the same if they ar

Recursion vs Iteration, What's the difference?
Reference https://tecoble.techcourse.co.kr/post/2020-04-30-iterationvsrecursion/ https://www.enjoyalgorithms.com/blog/time-complexity-analysis-of-recu

[Leetcode] 704. Binary Search
📄 Description Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. I