This course takes an in-depth look at recursion and its uses in Python.
Overview
Syllabus
Introduction
- The power of recursion
- What you should know
- Working with GitHub Codespaces
- A note about file paths
- The concept of recursion
- Why recursion is important
- Exceptions to GitHub Codespaces
- The ingredients of a recursive algorithm
- Recursion in action
- The factorial function: Iterative version
- A recursive factorial function
- Winding and unwinding the call stack in recursion
- Challenge: Fix the recursive algorithm
- Solution: The fundamentals of recursion
- Recursive Fibonacci function in Python
- Recursive sum function in Python
- Recursive greatest common divisor function in Python
- Recursive multiplication algorithm in Python
- Recursive exponentiation algorithm in Python
- String length recursive algorithm
- Introduction to quicksort
- Coding the quicksort algorithm in Python
- Challenge: Check your understanding of quicksort
- Solution: Check your understanding of quicksort
- Traversing a Linked List using recursion
- Traversing a tree using recursion: Overview
- Traversing a tree using recursion: Python implementation
- Challenge: Tree traversal
- Solution: Tree traversal
- Memory considerations with recursive algorithms
- Memoization in Python
- Tail call optimization in Python
- H-tree fractal using Python Turtle graphics
- Sierpinski triangle
- Introduction to the Towers of Hanoi puzzle
- Coding the Towers of Hanoi puzzle in Python
- Recursion vs. iteration
- Conclusion
Taught by
Robin Andrews