tree.h

来自「用C实现树和图的相关算法」· C头文件 代码 · 共 57 行

H
57
字号
#ifndef TREE_H
#define TREE_H
#include "list.h"
#include "poly.h"
#include "string.h"

typedef struct treeType
{
	list vertices;
	mystring treeName;
}*tree;


typedef struct vertexType
{
	list edges;
	int level;
	poly vInfo;
}*vertex;


typedef struct edgeType
{
	vertex from;
	vertex to;
	poly eInfo;
}*edge;


tree newTree(mystring name);
vertex newVertex(poly el);
edge newEdge(vertex start,vertex end);
void treeInsertVertex (tree t, poly v);
vertex searchVertex(tree t,poly x);
void treeInsertEdge (tree t, poly from, poly to);
edge searchEdge(tree t,poly start,poly end);
void treeInsertEdgeInfo (tree t, poly from, poly to, poly info);
void visit(poly x);
void treePreOrder (tree t, vertex root);                
void treeInOrder (tree t, vertex root);
void treePostOrder (tree t, vertex root);
void treeLevelOrder (tree t);              //从根开始遍历



/*
 
  void treeToJpg (tree t, char *fileName);

  
*/




#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?