Курсовая работа: Работа со списками
if (q==NULL) delete(q); else {p->next=p->next->next;delete(q);}
}//end stack remove
void change(int index, Data value){
p=top;
for (int i=1;i<index;i++) p=p->next;
p->inf=value;
}//end stack change
Data getvalue(int index){
if (index<=this->count()){
p=top;
for (int i=1;i<index;i++) p=p->next;
return(p->inf);
}//end if
}//end function
AnsiString getname(int index){
p=top;
for (int i=1;i<index;i++) p=p->next;
return(p->name);
}//end function
void clear(){
}//end function
};//end class stack
//==========================================
//3. CLASS QUEUE
//==========================================
template <class Data> class queue: public stack <Data> {
public:
queue(){top=new list;top->next=NULL;p=top;}
~queue(){}