Шпаргалка: Реализация списка
Tree *Root;
List *LNext;
List *LPrev;
};
List::List(int Digit)
{Root=NULL;
for (int i=Digit*10; i<Digit*10+10; i++)
{Tree *PTree;
PTree=new Tree(i);
PTree->LP=NULL;
PTree->RP=NULL;
if (Root==NULL)
Root=PTree;
else
{Tree *PTree1=Root;
do
{if (PTree1->LP!=NULL)
PTree1=PTree1->LP;}
while (PTree1->LP!=NULL);
PTree1->LP=PTree;
PTree=NULL; PTree1=NULL;
}
}
}
class TreeWork : private List
{public:
void TreeWorkStart();
private:
int ElementQuantity;