#recursion
Recursion
Introduction Recursion is a programming technique where a function calls itself to solve a problem by breaking it down into smaller, similar subproblems. Think of Russian nesting dolls—each doll contains a smaller version of itself until you reach the smallest one that doesn’t open. Recursion is fundamental to computer science and appears in tree traversals, sorting algorithms, mathematical computations, and backtracking problems. While it can seem magical at first, understanding recursion unlocks powerful problem-solving techniques. Read more →
November 19, 2025
Depth-First Search (DFS)
Introduction Depth-First Search (DFS) is a fundamental graph traversal algorithm that explores as far as possible along each branch before backtracking. Think of it like exploring a maze by always taking the first path you see, going as deep as possible, then backtracking when you hit a dead end. DFS is essential for detecting cycles, topological sorting, finding connected components, and solving maze/puzzle problems. Unlike BFS which uses a queue, DFS uses a stack (or recursion, which implicitly uses the call stack). Read more →
November 19, 2025