Ad
  • Default User Avatar

    Sorry but no. I had recursion beaten into me while in Computer Science faculty. And once I got the basic idea of it, it just stuck with me.
    But I can point you to algorithms with which I had first experience with recursion (all of them are sorting algorithms btw). Those algorithms are: QuickSort, MergeSort and HeapSort.

    Also always keep in mind. Every recursive function can be turned into iterative function (for some stack may be needed (if they are not tail recursion)).

    TL;DR for tail recursion: If the last thing you do in recursife function is a call to itself, than it is tail recursion. Like this solution :). And other solutions for this problem.

    Also maybe check out the collection of books by Donald Knuth called The Art of Computer Programming, WIKIPEDIA. So far those books are far the best if you want to learn algorithms and how they work.

  • Default User Avatar

    Thanks.

    Knowing ES6+ shortens your code alot. :)