代码搜索:递归回溯
找到约 2,805 项符合「递归回溯」的源代码
代码结果 2,805
www.eeworm.com/read/223339/14644465
cpp algo0603.cpp
Status InOrderTraverse(BiTree T, Status (*Visit)(ElemType)) {
// 算法6.3
// 采用二叉链表存储结构,Visit是对数据元素操作的应用函数。
// 中序遍历二叉树T的非递归算法,对每个数据元素调用函数Visit。
stack S;
BiTree p;
InitStack(S); p = T
www.eeworm.com/read/119742/14823259
c twofen.c
//二分递归查找最大和最小元素
//YCL
//2004.10.27
#include
//定义一个类,表示最大和最小元素的组合
class MaxMin{
private:
int max,min;
public:
MaxMin(int x,int y)//构造函数,给max和min附最大和最小元素的值
{
if(x>y)
{
www.eeworm.com/read/219502/14878074
cpp algo0603.cpp
Status InOrderTraverse(BiTree T, Status (*Visit)(ElemType)) {
// 算法6.3
// 采用二叉链表存储结构,Visit是对数据元素操作的应用函数。
// 中序遍历二叉树T的非递归算法,对每个数据元素调用函数Visit。
stack S;
BiTree p;
InitStack(S); p = T
www.eeworm.com/read/208856/15234106
cpp algo0603.cpp
Status InOrderTraverse(BiTree T, Status (*Visit)(ElemType)) {
// 算法6.3
// 采用二叉链表存储结构,Visit是对数据元素操作的应用函数。
// 中序遍历二叉树T的非递归算法,对每个数据元素调用函数Visit。
stack S;
BiTree p;
InitStack(S); p = T
www.eeworm.com/read/195829/5107114
c 7.7.c
/*用非递归过程实现深度优先搜索*/
void DepthFirstSearch(Graph g,int v0) /*从v0出发深度优先搜索图g*/
{
InitStack(S); /*初始化空栈*/
Push(S,v0);
while(!Empty(S))
{
v=Pop(S);
if(!visited(v)) /*栈中可能有重复结点*/
{
www.eeworm.com/read/306178/3748668
c mgmap.c
//Map here功能 By JackyBoy 1999/11/19
//由于严重影响速度(递归调用导致!),所以进行此命令的使用应该减少玩家的精力或者气息
#include
#define MaxX 7
#define MaxY 30
inherit F_CLEAN_UP;
int X=7,Y=10;
static mixed m;
static strin
www.eeworm.com/read/303129/3815308
c 7.7.c
/*用非递归过程实现深度优先搜索*/
void DepthFirstSearch(Graph g,int v0) /*从v0出发深度优先搜索图g*/
{
InitStack(S); /*初始化空栈*/
Push(S,v0);
while(!Empty(S))
{
v=Pop(S);
if(!visited(v)) /*栈中可能有重复结点*/
{
www.eeworm.com/read/475726/6776284
cpp algo0603.cpp
Status InOrderTraverse(BiTree T, Status (*Visit)(ElemType)) {
// 算法6.3
// 采用二叉链表存储结构,Visit是对数据元素操作的应用函数。
// 中序遍历二叉树T的非递归算法,对每个数据元素调用函数Visit。
stack S;
BiTree p;
InitStack(S); p = T
www.eeworm.com/read/473191/6857856
txt 最长公共序列.txt
#include
#include
//求最长公共子序列
//两种做法:递归、状态数组表
/*
测试数据如下
输入:
7 5
1 3 4 4 7 8 9
3 4 4 8 10
输出:
4
*/
int cal(int *a,int *b,int ca,int cb)
{
int tempa,tempb;
if
www.eeworm.com/read/293882/8266636
cpp algo3-8.cpp
// algo3-8.cpp 用递归调用求Ackerman(m,n)的值
#include
int ack(int m,int n)
{
int z;
if(m==0)
z=n+1; // 出口
else if(n==0)
z=ack(m-1,1); // 对形参m降阶
else
z=ack(m-1