代码搜索:递归回溯
找到约 2,805 项符合「递归回溯」的源代码
代码结果 2,805
www.eeworm.com/read/287357/8690236
c 56.c
#include
void diguistring(int n);
/*题目:利用递归函数调用方式,将所输入的n个字符,以相反顺序打印出来。*/
void C_program027()
{
int n;
printf("enter the number :\n");
scanf("%d",&n);
getchar();
diguistring(n);
www.eeworm.com/read/431296/8690781
c 6.42.c
6.42③ 编写递归算法,计算二叉树中叶子结点的数目。
要求实现下列函数:
void Leaves(BiTree bt, int &x);
/* Count the leaf node of the BiTree */
/* whose root node is bt to x. */
二叉链表类型定义:
typedef struct BiTNode {
www.eeworm.com/read/285689/8822642
c factori2.c
int Fact ( int n )
{/*求正整数n阶乘值的非递归算法*/
int i,fac;
fac=1; /*将变量fac初始化为Fact(0)的值*/
for (i=1;i
www.eeworm.com/read/285689/8822652
c listorder2.c
#define MAXSIZE 20
typedef int listarr[MAXSIZE];
void listorder(listarr list,int left, int right)
{ /*将数组段list[left..right]中的元素按中点优先的顺序输出(非递归实现)*/
typedef struct {
int l; /*存放等待处理的数组段的起
www.eeworm.com/read/382410/9030714
txt 新建 文本文档.txt
树、二叉树
二叉树的中序非递归遍历算法
int InTraverse(BiTree T)
{
Stack S;
InitStack(S);
while(T!==NULL || !Empty(S))
{
while(T!=NULL)
{
Push(S, T);
T = T->lchild;
}
T = Top(S); Pop(S)
www.eeworm.com/read/185294/9044333
htm s05_11.htm
递归函数-求GCD
function gcd(m,n)
{//求两个数m,n的最大公约数
var q;//保存m整除n后的余数
q = m%n;
if (q==0)
return n;
else
return g
www.eeworm.com/read/378375/9233360
java examp2_4.java
//本程序取自王晓东编著“算法分析与设计”第 21 页,例2.4
//排列问题的递归解法
import java.io.*;
public class Examp2_4
{
public static void swap(int []a,int i,int j)
{
int temp=a[i];
a[i]=a[j];
a[j]
www.eeworm.com/read/378375/9233371
java examp2_1.java
//本程序取自王晓东编著“算法分析与设计”第 20 页,例2.2
//Factorial数列的递归解法
import java.io.*;
class Examp2_1
{
static long fac(int n)
{
if (n==1)
return 1;
else
return n*fac(n-1);
}
www.eeworm.com/read/180019/9322506
cpp 8_74.cpp
#include
#include
template
void QuickSort(T*const array,int low,int high)
{ //递归实现
int i=low,j=high;
T temp=array[low]; //取第一个对象为进行调整的标准对象
while(i
www.eeworm.com/read/374949/9378081
cpp 8_74.cpp
#include
#include
template
void QuickSort(T*const array,int low,int high)
{ //递归实现
int i=low,j=high;
T temp=array[low]; //取第一个对象为进行调整的标准对象
while(i