Using Recursion like a Pro - 1

ben66yueh

YuehBen66

Posted on July 14, 2022

Using Recursion like a Pro - 1

Why I write this post ?

In order to be a better programmer,
getting a dream software job,
all developers must face the devil call "Algorithms",
especially something called "Recursion" really showed me how DESPERATION looks like ๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ๐Ÿ˜ตโ€๐Ÿ’ซ.

ย 

After struggling for a while,
I search for "How to use Recursion comfortably",
and finally found a book called Think like a programmer.

Think Like a programmer book

ย 

This book really SAVED MY LIFE !!! ๐Ÿฅณ๐Ÿฅณ๐Ÿฅณ,
and now I can use Recursion pretty comfortably,
even able to solve the medium Tree problem within 10 mins,
which is extremely amazing !!!

ย 

And I want to share you guys such amazing experience,
so you won't suffer from it.

ย 

Prerequisite of being a Pro

Before becoming a recursion pro, let's review basics of recursion.

ย 

Recursion means "calling itself",
and it has 2 vital concepts,
which are Recurrence relation and Base case,

ย 

  • Recurrence relation :
the relationship between the problem and its direct 
subproblems
Enter fullscreen mode Exit fullscreen mode
  • Base case :
the simplest case, which the function can handle on its own 
without calling itself.
Enter fullscreen mode Exit fullscreen mode

( if you're not familiar with these concepts, you can read the Martin and Dragon story )

ย 

...to be continued

ย 

References

๐Ÿ’– ๐Ÿ’ช ๐Ÿ™… ๐Ÿšฉ
ben66yueh
YuehBen66

Posted on July 14, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

ยฉ TheLazy.dev

About