recursion(2)
-
3.2. Recursion - 3.2.2 Non-Tail Recursion
CS - 3. Common Algorithms - 3.2. Recursion - 3.2.2 Non-Tail Recursion 💡Tail recursion is when a function can directly return the result of a recursive call - there are no outstanding operations, and there is no need for the call stack frame to be preserved. So it can be translated to a “goto with arguments”, and the stack usage will be constant. In “non-tail recursion”, there are outstanding ope..
2024.01.22 -
3.2. Recursion - 3.2.1 Tail Recursion
CS - 3. Common Algorithms - 3.2. Recursion - 3.2.1. Tail Recursion 3.2 Recursion 💡 Recursion is a method of solving problems where the solution depends on solutions to smaller instances of the same problem. A recursive algorithm must have a base case. A recursive algorithm calls itself, recursively. 재귀는 동일한 문제의 작은 인스턴스에 대한 해결책에 따라 해결책이 달라지는 문제를 해결하는 방법입니다. 재귀 알고리즘에는 기본 사례가 있어야 합니다. 재귀 알고리즘은 스스로를..
2024.01.21