About 72 results
Open links in new tab
  1. Recursion (article) | Recursive algorithms | Khan Academy

    Recursion has many, many applications. In this module, we'll see how to use recursion to compute the factorial function, to determine whether a word is a palindrome, to compute powers of a number, to …

  2. Recursive factorial (article) | Algorithms | Khan Academy

    This is a very clear explanation, but I wonder if you might want to include some cautionary language about using recursion in the real world. In Steve McConnell's book Code Complete, he says this (p. …

  3. Using recursion to determine whether a word is a palindrome

    How can you use recursion to determine whether a word is a palindrome? Let's start by understanding what's a base case. Consider the word a. It's a palindrome. In fact, we don't have to think of …

  4. The factorial function (article) | Khan Academy

    For our first example of recursion, let's look at how to compute the factorial function. We indicate the factorial of n by n! . It's just the product of the integers ...

  5. Sierpinski Gasket Playground | Khan Academy

    255, 255, 255; 255, 255, 0;

  6. Merge sort algorithm overview (article) | Khan Academy

    Recursive versions of algorithms are generally slower, due to added function calls, and each function call consumes memory from the stack (until the function returns).

  7. Towers of Hanoi (article) | Algorithms | Khan Academy

    If you've gone through the tutorial on recursion, then you're ready to see another problem where recursing multiple times really helps. It's called the Towers of Hanoi. You are given a set of three …

  8. Properties of recursive algorithms (article) | Khan Academy

    Here is the basic idea behind recursive algorithms: To solve a problem, solve a subproblem that is a smaller instance of the same problem, and then use the solution to that smaller instance to solve the …

  9. Computing powers of a number (article) | Khan Academy

    The recursive steps for odd exponents goes towards 0 by subtracting 1 from the exponent. If the exponent was negative, subtracting 1 would move away from 0, rather than towards 0. So, we have …

  10. Improving efficiency of recursive functions - Khan Academy

    Memoization of Fibonacci In the case of the factorial function, an algorithm only benefits from the optimization of memoization when a program makes repeated calls to the function during its …