代码搜索:递归回溯
找到约 2,805 项符合「递归回溯」的源代码
代码结果 2,805
www.eeworm.com/read/473760/1396897
txt factorial.txt
{递归调用测试}
{功能:对于输入n,输出n的阶乘}
program sd
var integer s;
integer t;
procedure factor(integer n;var integer m);
var integer w;
begin
if n=0
then m:=1
else
factor(n-1,w);
m:=n*w
fi
en
www.eeworm.com/read/471368/1431487
java gcd_recursion.java
//【习3.24】 将辗转相除法求两个整数的最大公因数gcd(a,b)用递归方法实现。
public class GCD_recursion
{
public static int gcd(int a,int b) //返回a,b的最大公因数
{
if (b==0)
return a;
www.eeworm.com/read/195829/5107189
txt 6_8.txt
int PostTreeDepth(BiTree bt) /* 后序遍历求二叉树的高度递归算法 */
{
int hl,hr,max;
if(bt!=NULL)
{
hl=PostTreeDepth(bt->LChild); /* 求左子树的深度 */
hr=PostTreeDepth(bt->RChild); /* 求右子树的深度 */
max=hl>hr
www.eeworm.com/read/191242/5166661
bas alex3.bas
' 八皇后问题的递归解法
DIM A(8), S, MAX
S = 0: MAX = 0
GOTO MAIN
SEARCH:
A(S) = 0
WHILE A(S) < 8
OK = 1
X = 0
WHILE (X < S)
IF (A(X) = A(S)) THEN OK = 0' 哈哈还没有ABS靠下面两句实现
www.eeworm.com/read/191242/5166670
bas alex3.bas
' 八皇后问题的递归解法
DIM A(8), S, MAX
S = 0: MAX = 0
GOTO MAIN
SEARCH:
A(S) = 0
WHILE A(S) < 8
OK = 1
X = 0
WHILE (X < S)
IF (A(X) = A(S)) THEN OK = 0' 哈哈还没有ABS靠下面两句实现
www.eeworm.com/read/191242/5166680
bas alex3.bas
' 八皇后问题的递归解法
DIM A(8), S, MAX
S = 0: MAX = 0
GOTO MAIN
SEARCH:
A(S) = 0
WHILE A(S) < 8
OK = 1
X = 0
WHILE (X < S)
IF (A(X) = A(S)) THEN OK = 0' 哈哈还没有ABS靠下面两句实现
www.eeworm.com/read/191242/5166689
bas alex3.bas
' 八皇后问题的递归解法
DIM A(8), S, MAX
S = 0: MAX = 0
GOTO MAIN
SEARCH:
A(S) = 0
WHILE A(S) < 8
OK = 1
X = 0
WHILE (X < S)
IF (A(X) = A(S)) THEN OK = 0' 哈哈还没有ABS靠下面两句实现
www.eeworm.com/read/164351/5490022
txt factorial.txt
{递归调用测试}
{功能:对于输入n,输出n的阶乘}
program sd
var integer s;
integer t;
procedure factor(integer n;var integer m);
var integer w;
begin
if n=0
then m:=1
else
factor(n-1,w);
m:=n*w
fi
en
www.eeworm.com/read/303129/3815379
txt 6_8.txt
int PostTreeDepth(BiTree bt) /* 后序遍历求二叉树的高度递归算法 */
{
int hl,hr,max;
if(bt!=NULL)
{
hl=PostTreeDepth(bt->LChild); /* 求左子树的深度 */
hr=PostTreeDepth(bt->RChild); /* 求右子树的深度 */
max=hl>hr
www.eeworm.com/read/475726/6776427
cpp algo0706.cpp
void BFSTraverse(Graph G, Status (*Visit)(int v )) {// 算法7.6
// 按广度优先非递归遍历图G。使用辅助队列Q和访问标志数组visited。
QElemType v,w;
queue Q;
QElemType u;
for (v=0; v