//本程序只给出了算法思想 //读者可以自己完善本程序 int found=FALSE; Bitree* Find_Near_Ancient(Bitree T,Bitree p,Bitree q) //求二叉树T中结点p和q的最近共同祖先 { …
C++学习 源代码
汇集 C++学习 相关的电路原理图、PCB工程文件、单片机/FPGA源代码、数据手册与应用设计方案。
//本程序只给出了算法思想 //读者可以自己完善本程序 void Bitree_Copy_Nonrecursive(Bitree T,Bitree &U)//非递归复制二叉树 { InitStack(S1); InitStack(S2); p…
//本程序只给出了算法思想 //读者可以自己完善本程序 Status CreateBitree_SqList(Bitree &T,SqList sa)//根据顺序存储结构建立二叉链表 { Bitree ptr[sa.last+1]; //该数组储存与…
//本程序只给出了算法思想 //读者可以自己完善本程序 void PreOrder_Nonrecursive(Bitree T)//先序遍历二叉树的非递归算法 { InitStack(S); Push(S,T); //根指针进栈 while(…
//本程序只给出了算法思想 //读者可以自己完善本程序 typedef struct { int data; PBTNode *lchild; PBTNode *rchild; PBTNode *parent; } PBTNode,PBi…
//本程序只给出了算法思想 //读者可以自己完善本程序 typedef struct { BTNode* ptr; enum {0,1,2} mark; } PMType; //有mark域的结点指针类型 void PostOrder_Sta…
//本程序只给出了算法思想 //读者可以自己完善本程序 Status Insert_BiThrTree(BiThrTree &T,BiThrTree &p,BiThrTree &x) //在中序线索二叉树T的结点p下插入子树x { if(!p->l…
//本程序只给出了算法思想 //读者可以自己完善本程序 typedef struct{ BTNode node; int layer; } BTNRecord; //包含结点所在层次的记录类型 int FanMao(Bitree T)//求一…
//本程序只给出了算法思想 //读者可以自己完善本程序 typedef *LNode[MAXSIZE] CHashTable; //链地址Hash表类型 Status Build_Hash(CHashTable &T,int m) //输入一组关键字…
//本程序只给出了算法思想 //读者可以自己完善本程序 void Print_Hash(HashTable H) //按第一个字母顺序输出Hash表中的所有关键字, //其中处理冲突采用线性探测开放定址法 { for(i=1;i