Scala의 foldLeft, foldRight에 대한 설명을 들으며 이런 생각이 들었다.


foldLeft, foldRight의 차이점을 바탕으로 재귀호출의 형식을 구분하면,

  1. 현재 stack에서 계산한 결과를 다음 재귀호출의 인자로 사용하는 것.
  2. 재귀호출의 결과를 현재 stack에서 수행해야 할 계산의 인자로 사용하는 것.
  3. 1과 2를 모두를 조합한 것.


tail-recursion 가능 여부는

  • 1을 잘 다듬으면 tail-recursion으로 만들 수 있지만
  • 2와 3은 복귀해야 할 stack이 존재하므로 tail-recursion으로 만들 수 없다.


15년 만에 재귀호출을 조금 이해한 느낌이다.




Posted by 배트
,

'learnyounode' is a set of self-guided workshops. It is installed easily via npm and the content is also so great.


I'm new to Node.js. This is a wonderful entry point to get involved into node world!


Even though I just finished this practice and haven't had much information about how to utilize node, I'm just gonna proceed to build a simple API server. I'm so excited with expecting how simple the code will be!


To get information about this practice, check this:

https://github.com/workshopper/learnyounode


My practice code is here:

https://github.com/batt842/learnyounode

Posted by 배트
,