Struct Int: Null Null
Struct Int: Null Null
{
int data;
node *next;
};
class list
{
Private:
node *head, *tail;
public:
list()
{
head=NULL;
tail=NULL;
}
};
void display()
{
node *temp=new node;
temp=head;
while(temp!=NULL)
{
cout<<temp->data<<"\t";
temp=temp->next;
}
}
void delete_last()
{
node *current=new node;
node *previous=new node;
current=head;
while(current->next!=NULL)
{
previous=current;
current=current->next;
}
tail=previous;
previous->next=NULL;
delete current;
}
//create a link
link->key = key;
link->data = data;
if(isEmpty()) {
last = link;
} else {
head->prev = link;
link->next = head;
head = link;
if(head->next == NULL) {
last = NULL;
} else {
head->next->prev = NULL;
head = head->next;
return tempLink;
//create a link
link->key = key;
link->data = data;
if(isEmpty()) {
last = link;
} else {
last->next = link;
link->prev = last;
last = link;}