collectrecur.html
来自「数据结构词典(英文)」· HTML 代码 · 共 46 行
HTML
46 行
<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN">
<HTML lang="en-US">
<HEAD>
<TITLE>collective recursion</TITLE>
<META name="description"
content="Definition of collective recursion,
possibly with links to more information and implementations.">
<META name="keywords" content="collective recursion">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<H1>collective recursion</H1>
<P>
(algorithmic technique)
<P>
<strong>Definition:</strong>
A special form of <a href="tailrecursn.html" tppabs="http://hissa.nist.gov/dads/HTML/tailrecursn.html"><em>tail recursion</em></a>, where the results are produced during the recursive calls and nothing is returned. The recursion may be optimized away by executing the call in the current stack frame, rather than creating a new stack frame, or by deallocating the entire recursion stack at once rather than a little at each return.
<P><em>Note:
The following program prints the values greater than limit in a list. <pre> int overlimit(list l, int limit)<br> {<br> if (null == l) {<br> return;<br> }<br> <br> if (limit < head(l)) {<br> printf("%d\n", head(l));<br> }<br> overlimit(tail(l), limit);<br> } </pre> At the return, the compiler can deallocate all the memory for the recursion stack at once.</em>
<P>Author: <a href="terms.html#authorPEB" tppabs="http://hissa.nist.gov/dads/terms.html#authorPEB">PEB</a>
<hr>
Go to the
<A HREF="terms.html" tppabs="http://hissa.nist.gov/dads/terms.html">Algorithms, Data Structures, and Problems</A>
home page.
<hr>
If you have suggestions, corrections, or comments, please get in touch
with
<a href="javascript:if(confirm('http://hissa.nist.gov/~black/black.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://hissa.nist.gov/~black/black.html'" tppabs="http://hissa.nist.gov/~black/black.html">Paul E. Black</a>
(<a href="mailto:paul.black@nist.gov">paul.black@nist.gov</a>).
<p>
Entry modified Thu Dec 30 13:37:42 1999.<BR>
HTML page formatted Thu Dec 30 14:01:00 1999.
<P>
This page's URL is
<A href="collectrecur.html" tppabs="http://hissa.nist.gov/dads/HTML/collectrecur.html">http://hissa.nist.gov/dads/HTML/collectrecur.html</A>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?