2016年10月29日
摘要: int LeafCount(BiTree T){ if(T==NULL) return 0; if(T->lchild==NULL&&T->rchild==NULL) return 1; else return LeafCount(T->lchild)+LeafCound(T->rchild);} 阅读全文
posted @ 2016-10-29 21:53 Dove1 阅读(422) 评论(0) 推荐(0) 编辑
摘要: typedef char TElemType; typedef struct BiNode{ TElemType data; stuct BiNode *lchild,*rchild;}BiNode,*BiTree; tree create(){ int x; tree t; scanf("%d", 阅读全文
posted @ 2016-10-29 21:53 Dove1 阅读(376) 评论(0) 推荐(0) 编辑
摘要: #include<cstdio>#include<cstring>#include<iostream>using namespace std; struct Node{ char data; Node *lchild,*rchild;}; Node* createtree(string pre,st 阅读全文
posted @ 2016-10-29 21:52 Dove1 阅读(721) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#include<malloc.h>#include<string.h> char s1[1000],s2[1000],s3[1000],s4[1000]; typedef struct node{ char data; stru 阅读全文
posted @ 2016-10-29 21:50 Dove1 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 实验目的:掌握二叉树的二叉链存储结构及表示。 掌握二叉树的三种遍历算法(递归和非递归两类)。 运用三种遍历的方法求解二叉树的有关问题。 实验内容:实现二叉树的二叉链表存储结构; 实现先序、中序和后序遍历二叉树; 遍历二叉树的应用:计算叶子结点、左右子树交换等。 要求:1、二叉树基本操作已实现,学习和 阅读全文
posted @ 2016-10-29 21:48 Dove1 阅读(957) 评论(0) 推荐(0) 编辑