if (root != 0) {
if (item > root->item)
{
root->right = insert(root->right, item);
return root;
}
else
{
root->left = insert(root->left, item);
return root;
}
}
else {
Tree *root = new Tree;
root->item = item;
root->left = NULL;
root->right = NULL;
return root;
}
for (int i = level; i >= 0; i--)
cout << root->item;
preorder(root->left, level + 1);
preorder(root->right, level + 1);