二叉树头文件

 1 //@ author 成鹏致远
 2 //@ net http://infodown.tap.cn
 3 //@ qq 552158509
 4 //@ blog lcw.cnblogs.com
 5 
 6 #ifndef __BINTREE_H
 7 #define __BINTREE_H
 8 
 9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <stdbool.h>
12 
13 
14 typedef char datatype_tree;
15 
16 typedef struct tree
17 {
18     datatype_tree data_t;
19     struct tree *lchild,*rchild;
20 }bin_tree,*bin_ptree;
21 
22 extern void bintree_create(bin_ptree *ptree);//create a binary tree
23 extern void pre_order(bin_ptree ptree);//iterate voer a binary tree,begin with root
24 extern void in_order(bin_ptree ptree);//iterate over a binary tree,begin with left child
25 extern void post_order(bin_ptree proot);//iterate over a binary tree,begin with right child
26 extern void level_order(bin_ptree proot);
27 extern void travel(char *str, void(*pfun)(bin_ptree),bin_ptree proot);
28 
29 #endif
View Code

相关文章:

  • 2021-07-30
  • 2021-08-18
  • 2021-11-15
  • 2021-05-16
  • 2021-08-21
  • 2021-06-13
  • 2021-11-01
猜你喜欢
  • 2021-10-20
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-06-03
  • 2021-11-22
  • 2022-01-22
相关资源
相似解决方案