PPPP
PPPP
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
temp->data=d;
temp->prev=NULL;
temp->next=head;
head->prev=temp;
head=temp;
return head;
};
int main(){
head->data=20;
current->data=30;
ptr->data=40;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
head->next=current;
current->next=ptr;
ptr->next=NULL;
int d=10;
head=add(head,d);
while(head!=NULL){
printf("%d <->",head->data);
head=head->next;
printf("NULL \n");
return 0;
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
temp->data=d;
temp->next=NULL;
while(ne->next!=NULL){
ne=ne->next;
ne->next=temp;
temp->prev=ne;
int main(){
head->data=20;
current->data=30;
ptr->data=40;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
head->next=current;
current->next=ptr;
ptr->next=NULL;
int d=10;
add(head,d);
while(head!=NULL){
printf("%d<->",head->data);
head=head->next;
printf("NULL");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
temp->data=d;
temp->next=NULL;
while(ne->data!=30){
ne=ne->next;
temp->prev=ne;
temp->next=ne->next;
ne->next=temp;
int main(){
head->data=20;
current->data=30;
ptr->data=40;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
head->next=current;
current->next=ptr;
ptr->next=NULL;
int d=10;
add(head,d);
while(head!=NULL){
printf("%d<->",head->data);
head=head->next;
printf("NULL");
return 0;
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
if(temp->next==NULL){
printf("THE LIST IS EMPTY!");
}else{
temp=temp->next;
free(p);
p=NULL;
temp->prev=NULL;
head=temp;
return head;
};
int main(){
head->data=20;
current->data=30;
ptr->data=40;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
head->next=current;
current->next=ptr;
ptr->next=NULL;
head=delet(head);
while(head!=NULL){
printf("%d<->",head->data);
head=head->next;
printf("NULL");
return 0;
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
if(temp->next==NULL){
}else{
while(temp2->next!=NULL){
temp1=temp2;
temp2=temp2->next;
temp1->next=temp2->next;
temp2->prev=NULL;
free(temp2);
head=temp;
return head;
};
int main(){
head->data=20;
current->data=30;
ptr->data=40;
top->data=50;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
top->prev=ptr;
head->next=current;
current->next=ptr;
ptr->next=top;
top->next=NULL;
head=delet(head);
while(head!=NULL){
printf("%d<->",head->data);
head=head->next;
}
printf("NULL");
return 0;
#include<stdio.h>
#include<stdlib.h>
struct NODE{
int data;
};
if(temp->next==NULL){
}else{
while(temp2->data!=40){
temp1=temp2;
temp2=temp2->next;
temp1->next=temp2->next;
temp2->prev=NULL;
free(temp2);
}
head=temp;
return head;
};
int main(){
head->data=20;
current->data=30;
ptr->data=40;
top->data=50;
head->prev=NULL;
current->prev=head;
ptr->prev=current;
top->prev=ptr;
head->next=current;
current->next=ptr;
ptr->next=top;
top->next=NULL;
head=delet(head);
while(head!=NULL){
printf("%d<->",head->data);
head=head->next;
printf("NULL");
return 0;
14.
#include<stdio.h>
#include<stdlib.h>
struct Node{
int data;
struct Node*next;
};
struct Node*createNode(int d)
newNode->data=d;
newNode->next=NULL;
return newNode;
if(!list1)return list2;
if(!list2)return list1;
if(list1->data<list2->data){
list1->next=MergeList(list1->next,list2);
return list1;
}else{
list2->next=MergeList(list1,list2->next);
return list2;
while(head!=NULL){
printf("%d",head->data);
head=head->next;
list1=createNode(1);
list1->next=createNode(3);
list1->next->next=createNode(5);
list2=createNode(2);
list2->next=createNode(4);
list2->next->next=createNode(6);
struct Node*MergedList=MergeList(list1,list2);
PrintList(MergedList);