Recursion For Programmers
Understanding how recursion works
Recursion is a powerful programming technique. A function that calls itself recursively not only saves programming effort and avoids repetition but it can also be used to navigate complex structures such as Trees and Class Hierarchies.
This is an intermediate-to-advanced level course. It is aimed at programmers who can already program confidently in one or more programming languages. It is not appropriate for beginners.
The courses includes numerous short sample programs to show how recursion works. There are samples written in C, Ruby and C#. However, you don’t need to program in those languages to follow this course. Recursion works the same way in all mainstream programming languages. This course explains the theory and the practice of recursion. You can use the techniques that are taught to write recursive functions in whichever language you prefer: C, C#, Java, JavaScript, Python, Basic, Pascal and others. The course is not about any specific language.
- This is what you will learn…
- What is recursion?
- How variables are scoped in recursive functions
- How recursive functions return values
- The Stack and Stack Frames
- Debugging recursive functions
- Recursion v Iteration
- Stack Corruption, and how to avoid it
- Infinite Recursion, and how to avoid it
- Recursing Fibonacc Numbers
- Recursing a Class Hierarchy
- Trees and recursion
- Navigating subdirectories recursively
Your Instructor
Huw Collingbourne has been a programmer for more than 30 years. He is a well-known technology writer in the UK. For over ten years he wrote the Delphi and Object Pascal programming column for PC Plus Magazine. He has also written numerous opinion and programming columns (including tutorials on C, C#, Java, Smalltalk, Delphi and Ruby) for a number of computer magazines, such as Computer Shopper, Flash & Flex Developer’s Magazine, PC Pro, and PC Plus.
He is author of a number of books on programming topics published by Bitwise Books: http://www.bitwisebooks.com.
In the 1980s he was a pop music journalist and interviewed most of the New Romantic stars, such as Duran Duran, Spandau Ballet, Adam Ant, Boy George, and Depeche Mode. He is now writing a series of New Romantic murder mysteries.
At various times Huw has been a magazine publisher, editor, and TV broadcaster. He has an MA in English from the University of Cambridge and holds a 2nd dan black belt in aikido, a martial art which he teaches in North Devon, UK (http://hartlandaikido.co.uk/). The aikido comes in useful when trying (usually unsuccessfully) to keep his Pyrenean Mountain Dogs under some semblance of control.
Course Curriculum
-
PreviewWhat is this course about? (1:46)
-
PreviewHow to follow this course (3:01)
-
StartReadme
-
StartSource Code Archive [DOWNLOAD]
-
StartWhat is Recursion For? (2:36)
-
PreviewA Simple Recursive Function (4:12)
-
PreviewDebugging Recursion (7:44)
-
StartRecursion and variable scope (2:07)
-
StartHow recursion works (5:35)
-
StartRecursion and Stack Frames (3:09)
-
StartDebug Call Stack (5:57)
-
StartMore Recursion (4:30)
-
StartRecursion in Ruby (2:15)
-
StartRecursive Functions that return values (5:21)
-
StartReturn values are special (2:37)
-
StartRecursion, Iteration or Arithmetic (4:04)
-
StartRecursing Fibonacci Numbers (5:03)
-
StartIterating Fibonacci Numbers (2:29)
-
StartInfinite Recursion (3:28)
-
StartThe order of arguments (5:22)
-
StartStack Corruption (7:30)
-
StartHow Does Stack Corruption Occur? (4:35)
-
StartHow The Stack Grows (3:56)
-
StartStack Frames (4:16)
-
StartRecursing a class library (5:26)
-
StartRecursing through tree structures (6:32)
-
StartDirectory Navigation an example in C (8:58)
-
StartDirectory Navigation an example in Ruby (7:24)
-
StartSummary of Directory Navigation (1:30)
-
StartWhat next? (2:22)