递归练习的问题。 [英] questions for recursion practise.
问题描述
我希望在递归方面做好练习。
可以为任何人提供递归问题网站的链接。或者
问题。
i want good practice over recursion.
can any one give me links for recursion questions site.?? or
question.
推荐答案
11月3日,11:56 * pm,Muzammil< muzammilPeer ... @ gmail.comwrote:
On Nov 3, 11:56*pm, Muzammil <muzammilPeer...@gmail.comwrote:
i希望在递归时做好练习。
可以给任何人提供* me *链接的递归问题网站。或者
问题。
i want good practice over recursion.
can any one give *me *links for recursion questions site.?? or
question.
考虑尝试C ++递归 C ++ Fibonacci是指C ++ Fibonacci。在谷歌。
你需要一个问题吗?确定...
#include< iostream>
void recurse(int n)
{
std :: cout<< n = << n<< std :: endl;
if(n 0)
recurse( - n);
}
int main()
{
recurse(10);
}
recurse()调用多少次? (不是10次)
如果使用负数代替10,会发生什么?
无限递归发生时会发生什么?你能解释一下原因吗?
Consider trying "C++ recursion" of "C++ Fibonacci" in google.
You need a question? sure...
#include <iostream>
void recurse(int n)
{
std::cout << "n = " << n << std::endl;
if(n 0)
recurse(--n);
}
int main()
{
recurse(10);
}
How many times will recurse() call itself? (its not 10 times)
What would happen if a negative number were used instead of 10?
What happens when infinite recursion occurs? Can you explain why?
Salt_Peter写道:
[...]
Salt_Peter wrote:
[...]
void recurse(int n)
{
std :: cout<< n = << n<< std :: endl;
if(n 0)
recurse( - n);
}
int main()
{
recurse(10);
}
recurse()调用多少次? (不是10次)
void recurse(int n)
{
std::cout << "n = " << n << std::endl;
if(n 0)
recurse(--n);
}
int main()
{
recurse(10);
}
How many times will recurse() call itself? (its not 10 times)
真的吗?看起来它给自己称之为10次。
Really? Looks like it calls itself 10 times to me.
Muzammil ha scritto:
Muzammil ha scritto:
i希望在递归时做好练习。
任何人都可以给我链接递归问题网站。或者
问题。
i want good practice over recursion.
can any one give me links for recursion questions site.?? or
question.
这里是一个:
编写一个程序,计算x和y的总和,而不使用 +"
运算符或循环。
(一般来说,学习SML编程语言的基础应该
给你一个很好的理解递归。)
-
Christian Hackl
ha ** *@sbox.tugraz.at
这篇关于递归练习的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!