代码搜索:递归回溯
找到约 2,805 项符合「递归回溯」的源代码
代码结果 2,805
www.eeworm.com/read/285689/8822656
c listorder1.c
#define MAXSIZE 20
typedef int listarr[MAXSIZE];
void listorder(listarr list,int left, int right)
{ /*将数组段list[left..right]中的元素按中点优先的顺序输出(递归实现)*/
int mid;
if (left
www.eeworm.com/read/185058/9059266
cpp tree1_sort.cpp
#include "Tree1.h" //二叉树类
TreeNode1* insert(char ch,TreeNode1 *p) //将ch插入到以p为根结点的子树中,递归算法
{
if(p==NULL)
p=new TreeNode
www.eeworm.com/read/184790/9075639
txt 例4.11.txt
例4.11 用递归方法求n!。
有了例4.10的基础,很容易写出本题的程序:
#include
using namespace std;
long fac(int); //函数声明
int main( )
{int n; //n为需要求阶乘的整数
www.eeworm.com/read/379196/9204880
txt 例4.11.txt
例4.11 用递归方法求n!。
有了例4.10的基础,很容易写出本题的程序:
#include
using namespace std;
long fac(int); //函数声明
int main( )
{int n; //n为需要求阶乘的整数
www.eeworm.com/read/424004/10509165
cpp ex3_15.cpp
//【例3.15】用递归法求解Fibonacii数列。
#include
#include
using namespace std;
int fib(int n){
if(n==0) return 0;
else if(n==1) return 1;
else return fib(n-1)+fib(n-2);
}
int m
www.eeworm.com/read/274763/10853902
h bl.h
//二叉树三种遍历递归程序
//存储结构定义
typedef struct bitnode
{
char data;
struct bitnode *lchild,*rchild;
}bitnode,*bitree;
//先序遍历
void preorder(bitree t)
{
if(t)
{
cout
www.eeworm.com/read/273264/10921793
cpp ex3_15.cpp
//【例3.15】用递归法求解Fibonacii数列。
#include
#include
using namespace std;
int fib(int n){
if(n==0) return 0;
else if(n==1) return 1;
else return fib(n-1)+fib(n-2);
}
int m
www.eeworm.com/read/177475/7104534
m searchf.m
function str=searchf(d,str)
% 递归实现文件的查找
f = dir(d);
f=f(3:length(f));
num_f = length(f);
if num_f ~= 0
for i=1:num_f
f(i).name = strcat(d,'\',f(i).name);
www.eeworm.com/read/177475/7104536
txt searchf.txt
function str=searchf(d,str)
% 递归实现文件的查找
f = dir(d);
f=f(3:length(f));
num_f = length(f);
if num_f ~= 0
for i=1:num_f
f(i).name = strcat(d,'\',f(i).name);
www.eeworm.com/read/460348/7252964
c bintree_postorder_nrec.c
/* 二叉树后根周游的非递归算法*/
#include
#include
typedef char DataType;
struct BinTreeNode; /* 二叉树中结点 */
typedef struct BinTreeNode *PBinTreeNode; /* 结点的指针类