Застосування атд
13

}

temp = temp->next;

}

if(k){

cout<<"\nU spysku nema takoho elementa!\n";

}

}

void unionList(List *first, List *second){

head=first->head;

first->tail->next=second->head;

second->head->prew = first->tail;

tail=second->tail;

}

private:

element *head, *tail;

};

 

файл main.cpp

#include"List.h"

int main(void)

{

List *A=new List;

int kilk;

int temp;

cout<<"Vvedit rozmir poslidovnosti: ";

cin >>kilk;

for(int i=0; i<kilk; i++){

cout <<"Vvedit element: ";

cin >> temp;

if(temp>0){

cout <<"push("<< temp <<")\n";

A->push(temp);

}

if(temp<0){

cout <<"delete("<< -temp <<")";

A->del_elem(-temp);

}

A->Show();

}

return 0;

}