数据结构-树-
lwyingyyy
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
创建二叉排序树并查找值为x的节点(c语言版)
#include#include/*所谓二叉排序树,即左子树的值小于根节点,右子树的值大于根节点;中序遍历的结果从左到右为升序*/typedef struct node{ int data; struct node *lchild; struct node *rchild;}node;/*查找x*//*算法思想: 查找x的结果有原创 2015-12-13 21:55:53 · 3296 阅读 · 0 评论 -
后序遍历首尾点(C语言版)
#include #include typedef struct tree{ char data; struct tree*lchild,*rchild;}bintree;typedef bintree *tree;//ABD#E##FG###C##//后序遍历:EBGFBCAtree createtree(tree t){ char c=ge原创 2015-11-30 21:44:12 · 460 阅读 · 0 评论 -
中序遍历非递归算法(C语言版)
#include #include #define M 100//前序遍历:ABD#E##FG###C##typedef struct tree/*二叉树*/{ char data; struct tree *lchild,*rchild;}bintree;typedef bintree *tree;tree createTree()/*前序遍历建树*原创 2015-11-30 21:39:34 · 5217 阅读 · 0 评论 -
凹入表示法(C语言版)
#include #include #define m 3typedef struct k{ char data; struct k *child[m];}tree;/*前序遍历建树*/tree *createTree(){ tree *t; /*1、如果是‘#’则return;*/ char x=getchar();原创 2015-11-30 21:48:39 · 7856 阅读 · 2 评论 -
树的括号表示法(C语言版)
#include #include #define M 4//AB####CF####H######D####E####typedef struct k{ char data; struct k *child[M];}tree;/*前序遍历建树*/tree *createTree(){ tree *t;int i; char原创 2015-11-30 21:25:29 · 3166 阅读 · 0 评论 -
非递归前序遍历建树并查找首点尾点
#include #define M 100typedef struct tree{ char data; struct tree *lchild,*rchild;}bintree; /*定义树*/typedef bintree *tree;//ABD#E##FG###C##/*前序遍历建树*/tree createTree(){原创 2015-11-30 21:33:06 · 495 阅读 · 0 评论
分享