enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. Tail call - Wikipedia

    en.wikipedia.org/wiki/Tail_call

    Tail recursion (or tail-end recursion) is particularly useful, and is often easy to optimize in implementations. Tail calls can be implemented without adding a new stack frame to the call stack . Most of the frame of the current procedure is no longer needed, and can be replaced by the frame of the tail call, modified as appropriate (similar to ...

  3. Mutual recursion - Wikipedia

    en.wikipedia.org/wiki/Mutual_recursion

    Mutual recursion is very common in functional programming, and is often used for programs written in LISP, Scheme, ML, and similar programming languages. For example, Abelson and Sussman describe how a meta-circular evaluator can be used to implement LISP with an eval-apply cycle. [7] In languages such as Prolog, mutual recursion is almost ...

  4. Recursion (computer science) - Wikipedia

    en.wikipedia.org/wiki/Recursion_(computer_science)

    The significance of tail recursion is that when making a tail-recursive call (or any tail call), the caller's return position need not be saved on the call stack; when the recursive call returns, it will branch directly on the previously saved return position. Therefore, in languages that recognize this property of tail calls, tail recursion ...

  5. Map (higher-order function) - Wikipedia

    en.wikipedia.org/wiki/Map_(higher-order_function)

    The implementation of map above on singly linked lists is not tail-recursive, so it may build up a lot of frames on the stack when called with a large list. Many languages alternately provide a "reverse map" function, which is equivalent to reversing a mapped list, but is tail-recursive.

  6. Dynamic programming - Wikipedia

    en.wikipedia.org/wiki/Dynamic_programming

    For example, consider the recursive formulation for generating the Fibonacci sequence: F i = F i−1 + F i−2, with base case F 1 = F 2 = 1. Then F 43 = F 42 + F 41, and F 42 = F 41 + F 40. Now F 41 is being solved in the recursive sub-trees of both F 43 as well as F 42. Even though the total number of sub-problems is actually small (only 43 ...

  7. Continuation-passing style - Wikipedia

    en.wikipedia.org/wiki/Continuation-passing_style

    Every call in CPS is a tail call, and the continuation is explicitly passed. Using CPS without tail call optimization (TCO) will cause not only the constructed continuation to potentially grow during recursion, but also the call stack. This is usually undesirable, but has been used in interesting ways—see the Chicken Scheme compiler. As CPS ...

  8. Corecursion - Wikipedia

    en.wikipedia.org/wiki/Corecursion

    In computer science, corecursion is a type of operation that is dual to recursion.Whereas recursion works analytically, starting on data further from a base case and breaking it down into smaller data and repeating until one reaches a base case, corecursion works synthetically, starting from a base case and building it up, iteratively producing data further removed from a base case.

  9. McCarthy 91 function - Wikipedia

    en.wikipedia.org/wiki/McCarthy_91_function

    As one of the examples used to demonstrate such reasoning, Manna's book includes a tail-recursive algorithm equivalent to the nested-recursive 91 function. Many of the papers that report an "automated verification" (or termination proof ) of the 91 function only handle the tail-recursive version.