二叉树按先序遍历结果输入,空用0表示,并且中序遍历二叉树(节点值为字母)。总是错。c++。

论坛 期权论坛 期权     
匿名   2018-4-29 11:22   4710   1
#include
#include
#define TRUE 1
#define FALSE 0
#define OK 1
#define MAXSIZE 100


using namespace std;
typedef int Status;typedef int Elemtype;
typedef struct BINode
{
    Elemtype data;
    struct BINo...#include
#include
#define TRUE 1
#define FALSE 0
#define OK 1
#define MAXSIZE 100

using namespace std;
typedef int Status;typedef int Elemtype;
typedef struct BINode
{
    Elemtype data;
    struct BINode *lchild, *rchild;
} BINode, *BiTree;

Status TreeCreated = FALSE;
Status CreateBiTree (BiTree *T);
Status PreOrderTraverse (BiTree T);
Status InOrderTraverse (BiTree T);
Status PostOrderTraverse (BiTree T);

int main()
{
    int choice=0;
    Status leave=FALSE,flag;
    BINode *BT;
    cout
分享到 :
0 人收藏

1 个回复

倒序浏览
2#
r1renhw  4级常客 | 2018-4-30 01:03:56
//修改后的

#include
#include
#define TRUE 1
#define FALSE 0
#define OK 1
#define MAXSIZE 100

using namespace std;
typedef int Status;
typedef char Elemtype;///////////////////////////////
typedef struct BINode
{
    Elemtype data;
    struct BINode *lchild, *rchild;
} BINode, *BiTree;

Status TreeCreated = FALSE;
Status CreateBiTree (BiTree *T);
Status PreOrderTraverse (BiTree T);
Status InOrderTraverse (BiTree T);
Status PostOrderTraverse (BiTree T);

int main()
{
    int choice=0;
    Status leave=FALSE,flag;
    BINode *BT;
    cout
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:58388
帖子:6688
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP