помоги исправить, и с концом проги ничего не придумаю нормального
Код: Выделить всё
#include<iostream>
using namespace std
class tree
{
public:
int inf;
tree* right;
tree* left;
tree* root;
void init()
{
root=new tree;
root->left=NULL;
root->right=NULL;
root->NULL;
}
void add(int x,tree*&root)
{
if (root==NULL)
{
root=new tree;
root->left=root->right->NULL;
root->inf=x;
}
else if (x>root->inf)
add (x,root->right);
else add(x,root->left);
}
void del(tree *&root)
{
if (root!=NULL)
{
del(root->left);
del(root->right);
delete root;
}
}
void image (tree *&root)
{
if (root->left);
cout«" "«root->inf«" ";
image(root->right);
}
}
void na_ur(tree *&root,int &x)
{
if (root!=NULL)
{
mas[i]++;
i++;
na_ur(root->right,i,mas)
na_ur(root->left,i,mas)
};
}
}