Independently published, 2023. — 114 p.
In this book, Mr. Alexander brings his
well-known, simple teaching style to the topic of recursion, also known as
recursive programming. In the book you’ll learn how to write functions that call themselves. He covers the basics of recursion, and then covers the important topic of
tail recursion. The source code examples are written with the
Scala 3 programming language, but he doesn’t use
any special Scala techniques, so the code
should be readable if you know other languages like
C, C#, Java, Kotlin, Python, etc.NOTE: The lessons in this book are based on the
new version of
Functional Programming, Simplified (2017) that he’s currently rewriting in early 2023.
Welcome.
Recursion: Introduction.
Recursion: Motivation.
Recursion Background: Let’s Look at Lists.
Recursion: How to Write a ‘sum’ Function.
Recursion: How Recursive Function Calls Work.
Visualizing the Recursive sum Function.
Recursion: A Conversation Between Two Developers.
Recursion: Thinking Recursively.
JVM Stacks, Stack Frames, and Stack Overflow Errors.
A Visual Look at Stacks and Frames.
Tail-Recursive Algorithms.
Bonus: Processing I/O with Recursion.
The End.
True PDF