DEV Community

Discussion on: A Simple introduction to recursion

Collapse
 
dakujem profile image
Andrej Rypo • Edited

Chapter one: Tail Recursion.

To understand tail recursion, you need to understand Chapter One: Tail Recursion.

Collapse
 
anwarr_________ profile image
Anwar

This link goes to this article not an article about tail recursion

Collapse
 
dakujem profile image
Andrej Rypo

Come on, man, it's a joke! I updated the link...

Thread Thread
 
anwarr_________ profile image
Anwar

I'm pretty slow at getting jokes, I have just got it now, great one broπŸ˜‚πŸ˜‚πŸ˜‚

Thread Thread
 
anwarr_________ profile image
Anwar

liked the article ?

Thread Thread
 
dakujem profile image
Andrej Rypo

Well, if you're asking... It's curious you did not use the ever-present factorial example. The example provided does not really demonstrate the advantage of recursion. I'd use an example that would otherwise require a stack data structure, like an algo to detect palindromes, for example.

abcba --> true
abcde --> false
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
anwarr_________ profile image
Anwar

Yeah that's because the goal of writing this article was to clarify the main idea of recursion for absolute beginners, I wanted to make it as simple as possible so I came up with this simple example, maybe in an upcoming article I'll dive more deep into recursion
Thanks for your opinion