Well, I understand you but I can't do it properly.
My ideas are here in "pole"
every element to be firstly "1"
Code:
struct ELEM {
int key2, pole;
ELEM *left, *right;
} *root1, *root2;
After I make some changes(from the tree to send an element in a queue), "pole" must become '0' ( I have a function called "Available" which makes "pole" equals to "0" .
-----------
I've tried check right after NOMER but ..
Code:
while (NOMER!=0)
{
cout << "\n NOMER :";
cin>>NOMER;
if (NOMER=0) // here is the check, but not very usable
break; else
{
cout << "\n VALUE: ";
cin>>pol;
addTREE(NOMER, root1);
}
}
continue;
EDIT : Is it possible pole to be empty and "0" if the tree is in queue ?