mehran_h
پنج شنبه 03 دی 1394, 18:25 عصر
سلام ببخشید یه تکه کد نوشتم برا درست کردن درخت دودویی و درج در ان میخواستم ببینم درسته یا نه و بعدش اگه درسته در main چه گونه مقدارش باید بدم دقیقا اون جایی که *****گذاشتم ممنون میشم جواب بدید
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "conio.h"
#include "iostream"
using namespace std;
struct tree_node
{
char info;
tree_node *left,*right;
};
tree_node *root;
void tree_insert(tree_node *node,tree_node *left,tree_node *right,int data)
{
if(node==NULL)
{
root->right=right;
root->left=left;
root->info=data;
}
else
{
node-> right=right;
node-> left=left;
node-> info=data;
}
}
void _tmain()
{
char ch;
cout<<"enter char"<<endl;
cin>>ch;
while (ch!='0')
{
********
cin>>ch;
}
_getch();
}
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "conio.h"
#include "iostream"
using namespace std;
struct tree_node
{
char info;
tree_node *left,*right;
};
tree_node *root;
void tree_insert(tree_node *node,tree_node *left,tree_node *right,int data)
{
if(node==NULL)
{
root->right=right;
root->left=left;
root->info=data;
}
else
{
node-> right=right;
node-> left=left;
node-> info=data;
}
}
void _tmain()
{
char ch;
cout<<"enter char"<<endl;
cin>>ch;
while (ch!='0')
{
********
cin>>ch;
}
_getch();
}