-
-
慕九州5545173
2017-10-26
- 二叉树搜索误人子弟啊
-
截图
0赞 · 0采集
-
-
慕妹2098627
2017-08-24
- 在实现各个成员函数的时候,要结合它们的内在联系来决定实现顺序,像这里,当实现了搜索节点的函数后,其他的函数实现就简单多了
-
截图
0赞 · 0采集
-
-
Lgin
2017-03-08
- 递归的基本概念:程序调用自身的编程技巧称为递归,是函数自己调用自己.
迭代:利用变量的原值推算出变量的一个新值.如果递归是自己调用自己的话,迭代就是A不停的调用B.
迭代eg(s不停的调用i):
int funcB(int n)
{
int i,s=0;
for(i=1;i<n;i++)
s+=i;
return s;
}
-
截图
0赞 · 0采集
-
-
慕粉3829398
2017-01-16
- 函数声明
-
截图
0赞 · 0采集
-
-
milletluo
2016-11-20
- SearchNode
-
截图
0赞 · 0采集
-
-
精慕门4947531
2016-11-03
- #include"stdlib.h"
#include "Node.h"
Node::Node()
{
index=0;
data=0;
pLchild=NULL;
pRchild=NULL;
pParent=NULL;
}
Node *Node::SearchNode(int nodeindex)
{
if(this->index==nodeindex)
{
return this;
}
if(this->pLchild!=NULL)
{
if(this->pLchild->index==nodeindex)
{
return this->pLchild;
}
if(this->pRchild!=NULL)
{
if(this->pRchild->index==nodeindex)
{
return this->pRchild;
}
return NULL;
}
}
-
1赞 · 0采集
-
-
xuxinxin
2016-07-30
- 遍历寻找当前结点,当前结点的左右孩子是否为满足要求的索引。
-
截图
0赞 · 0采集