求二叉树结点路径 课程设计

来源:百度知道 编辑:UC知道 时间:2024/06/21 23:35:30
要有以下功能:
1.二叉树的建立;
2:求指定结点路径;
3;二叉树的前中后序遍历;

如果有查找的功能更好;

#include<iostream>
#include<stack>
#include<iomanip>
using namespace std;
#define MAX 1000
#define OK 1
#define ERROR 0
typedef struct node
{
int value;
struct node* left;
struct node* right;
}Node,*binary_tree;
binary_tree create();
void front(binary_tree head);
void mid(binary_tree head);
void behind(binary_tree head);
search(Node *T, int e);

int main(void)
{
cout<<"创建二叉树(0代表空): "<<endl;
binary_tree head=create();
cout<<"创建成功!!"<<endl<<endl;
while(1)
{

cout<<" 【~~~~欢迎光临~~~~】 "<<endl;
cout<<" "<<endl;
cout<<" *****二叉树上的结点路径***** "<<endl;
cout<<"