Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
The "trick" to writing recursive code
Rating: 4.5 out of 5(1 rating)
230 students

The "trick" to writing recursive code

A short course presenting a trick to quickly and correctly implement recursive functions.
Created byAhmed Hisham
Last updated 2/2026
English

What you'll learn

  • Learn to quickly and correctly write recursive functions
  • Acquire a simple mental check to test the completeness of recursive solutions/implementions
  • Tackle different classes of problems with the same trick
  • Conceptually understand recursive problem solving

Course content

2 sections16 lectures1h 56m total length
  • Introduction1:05

    Ahmad explains a simple trick to overcome getting stuck implementing recursive solutions and helps students translate recursive ideas into working code.

  • A note before we begin2:52
  • Recursive thinking: A Conceptual Walkthrough(Part 1: Intro)8:29
  • Recursive thinking: A Conceptual Walkthrough(Part 2: Problem Breakdown)8:17
  • Recursive thinking: A Conceptual Walkthrough(Part 3: Misconceptions)6:32
  • Recursive thinking: A Conceptual Walkthrough(Part 4: The Main Idea)6:47

    Learn to solve pyramid drawing through recursive thinking by deferring computation, establishing a base case, and building the full solution row by row from smaller sub-problems to any height.

  • Recursive thinking: A Conceptual Walkthrough(Part 5: The General Case)11:47
  • Recursive thinking: A Conceptual Walkthrough(part 6: The Computational View)6:57
  • The Pyramid Problem: Implementation(contains an important idea to the "trick")9:18
  • The Pyramid Problem: Execution Breakdown(+implementation completeness check)10:38
  • Before we continue(The recursive mindset)0:56

Requirements

  • Basic familiarity with a programming language(Python will be used)
  • Extremely basic familiarity with the concept of recursion

Description

This course presents a quick and effective trick to ease the implementation of recursive functions. The main objective of the course is to specifically overcome the experience of getting "stuck" while writing recursive function. There are also conceptual lectures discussing general concepts related to recursion. The so-called trick is discussed and applied practically through problems, then justified logically. Recursion is one of the most important topics for a computer scientist or programmer to understand. Recursion is also a vital concept to grasp for the study of data structures and algorithms . Python is used for implementation. This course is not for absolute beginner programmers as assumes a basic familiarity with at least one programming language. Also, the student being introduced to the basic ideas of recusion is preferred.  Python is used for implementation. This course is not for absolute beginner programmers as assumes a basic familiarity with at least one programming language. Also, the student being introduced to the basic ideas of recusion is preferred.  Python is used for implementation. This course is not for absolute beginner programmers as assumes a basic familiarity with at least one programming language. Also, the student being introduced to the basic ideas behind recursion is preferred.

Who this course is for:

  • All programmers who struggle with recursion!