SlideShare une entreprise Scribd logo
1  sur  5
Task: Define doubly linked .
code:
#include "stdafx.h"
#include<conio.h>
#include<iostream>
using namespace std;
class double_linklist
{
private:
struct node
{
int data;
node *prev;
node *next;
}*p;
int c;
public:
double_linklist()
{
p=NULL;
c=0;
}
bool isempty()
{
return(p==NULL);
}
void addatbeg(int num)
{
c++;
node *n;
n=new node;
n->data=num;
n->prev=NULL;
if(p==NULL)
{
n->next=NULL;
p=n;
}
else
{
n->next=p;
p->prev=n;
p=n;
}}
void addatend(int num)
{
c++;
node *n;
n=new node;
n->data=num;
n->next=NULL;
if(p==NULL)
{
n->prev=NULL;
p=n;
}
else
{
node *temp=p;
while(temp->next!=NULL)
{
temp=temp->next;
}
n->prev=temp;
temp->next=n;
}
}
void addafter(int num,int location)
{
if(isempty())
cout<<"Doubly link list is empty!!!"<<endl;
else if(c<location)
cout<<"Location not found!!!"<<endl;
else
{
c++;
node *n,*temp=p;
n=new node;
n->data=num;
while(1<location)
{
temp=temp->next;
location--;
}
temp->next->prev=n;
n->next=temp->next;
temp->next=n;
n->prev=temp;}}
void del(int num)
{
if(isempty())
cout<<"Doubly link list is empty!!!"<<endl;
else
{
node *temp=p;
while(temp!=NULL)
{
if(temp->data==num)
{
if(temp==p)
{
if(c==1)
p=NULL;
else
temp=p=p->next;
p->prev=NULL;
}
else if(temp->next==NULL)
{
temp->prev->next=NULL;
}
else
{
temp->next->prev=temp->prev;
temp->prev->next=temp->next;
}
c--;
}
temp=temp->next;}}}
void display()
{
if(p==NULL)
cout<<"Doubly link list is empty!!!"<<endl;
else
{
node *temp=p;
cout<<"Doubly link list elements are : "<<endl;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;}}}
void count()
{
cout<<"Total no of nodes is : "<<c<<endl;
}
~double_llist()
{
node *temp;
while(p!=NULL)
{
temp=p;
p=p->next;
delete temp;}}};
int _tmain(int argc, _TCHAR* argv[])
{
double_llist d_linkllist;
int c,num,location;
while(1)
{
cout<<"nDoubly linked list menu : "<<endl;
cout<<"n1.add at end of listn2.add at beginning of listn3.add after
specific in listn4.del from the list";
cout<<"n5.display the listn6.count total nodes of the
listn7.exit"<<endl;
cout<<"Enter your choice : ";
cin>>c;
switch(c)
{
case 1:
{
cout<<"Enter value : ";
cin>>num;
d_llist.addatend(num);
break;
}
case 2:
{
cout<<"Enter value : ";
cin>>num;
d_llist.addatbeg(num);
break;
}
case 3:
{
cout<<"Enter value : ";
cin>>num;
cout<<"Enter location after which you want to enter value : ";
cin>>location;
d_llist.addafter(num,location);
break;
}
case 4:
{
cout<<"Enter value : ";
cin>>num;
d_llist.del(num);
break;
}
case 5:
{
d_llist.display();
break;
}
case 6:
{
d_llist.count();
break;
}
case 7:
{
cout<<"You are exiting....."<<endl;
system("pause");
exit(0);
break;
}
default:
cout<<"Invalid choice!!!"<<endl;}}
system("pause");
return 0;}
Output:

Contenu connexe

Tendances

Tendances (19)

C++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLESC++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLES
 
CUDA First Programs: Computer Architecture CSE448 : UAA Alaska : Notes
CUDA First Programs: Computer Architecture CSE448 : UAA Alaska : NotesCUDA First Programs: Computer Architecture CSE448 : UAA Alaska : Notes
CUDA First Programs: Computer Architecture CSE448 : UAA Alaska : Notes
 
Go a crash course
Go   a crash courseGo   a crash course
Go a crash course
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 
C++ file
C++ fileC++ file
C++ file
 
Implement of c &amp; its coding programming by sarmad baloch
Implement of c &amp; its coding  programming by sarmad balochImplement of c &amp; its coding  programming by sarmad baloch
Implement of c &amp; its coding programming by sarmad baloch
 
Array using recursion
Array using recursionArray using recursion
Array using recursion
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 
New presentation oop
New presentation oopNew presentation oop
New presentation oop
 
Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++Simulador carrera de caballos desarrollado en C++
Simulador carrera de caballos desarrollado en C++
 
timingExercise
timingExercisetimingExercise
timingExercise
 
C++ 4
C++ 4C++ 4
C++ 4
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
 
Experement no 6
Experement no 6Experement no 6
Experement no 6
 
D vs OWKN Language at LLnagoya
D vs OWKN Language at LLnagoyaD vs OWKN Language at LLnagoya
D vs OWKN Language at LLnagoya
 
Coding with Vim
Coding with VimCoding with Vim
Coding with Vim
 
Code
CodeCode
Code
 

En vedette

Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500
ilsamaryum
 

En vedette (12)

Double checkedlockingjavasingletons
Double checkedlockingjavasingletonsDouble checkedlockingjavasingletons
Double checkedlockingjavasingletons
 
Programs of C++
Programs of C++Programs of C++
Programs of C++
 
Basic Programs of C++
Basic Programs of C++Basic Programs of C++
Basic Programs of C++
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Java ArrayList Video Tutorial
Java ArrayList Video TutorialJava ArrayList Video Tutorial
Java ArrayList Video Tutorial
 
Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Loops
LoopsLoops
Loops
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C++ programs
C++ programsC++ programs
C++ programs
 

Similaire à Doubly linklist

Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03
Nasir Mehmood
 
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdfData Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
jyothimuppasani1
 
computer notes - Data Structures - 3
computer notes - Data Structures - 3computer notes - Data Structures - 3
computer notes - Data Structures - 3
ecomputernotes
 
Write code in c++ Program to a topological sort on a graph Program pl.docx
Write code in c++ Program to a topological sort on a graph  Program pl.docxWrite code in c++ Program to a topological sort on a graph  Program pl.docx
Write code in c++ Program to a topological sort on a graph Program pl.docx
noreendchesterton753
 
#includeiostream struct node {    char value;    struct no.pdf
#includeiostream struct node {    char value;    struct no.pdf#includeiostream struct node {    char value;    struct no.pdf
#includeiostream struct node {    char value;    struct no.pdf
ankitmobileshop235
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
aathiauto
 
C++ Program to Implement Singly Linked List #includei.pdf
  C++ Program to Implement Singly Linked List  #includei.pdf  C++ Program to Implement Singly Linked List  #includei.pdf
C++ Program to Implement Singly Linked List #includei.pdf
anupambedcovers
 
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docxreverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
acarolyn
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdf
fantoosh1
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
fortmdu
 

Similaire à Doubly linklist (20)

Data structures cs301 power point slides lecture 03
Data structures   cs301 power point slides lecture 03Data structures   cs301 power point slides lecture 03
Data structures cs301 power point slides lecture 03
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docx
 
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdfData Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
Data Structure in C++Doubly Linked Lists of ints httpstaffwww.pdf
 
computer notes - Data Structures - 3
computer notes - Data Structures - 3computer notes - Data Structures - 3
computer notes - Data Structures - 3
 
Write code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docxWrite code in C++ Write a program to perform a topological sort on a g.docx
Write code in C++ Write a program to perform a topological sort on a g.docx
 
Write code in c++ Program to a topological sort on a graph Program pl.docx
Write code in c++ Program to a topological sort on a graph  Program pl.docxWrite code in c++ Program to a topological sort on a graph  Program pl.docx
Write code in c++ Program to a topological sort on a graph Program pl.docx
 
Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.Write a program that calculate the no of prime no,even and odd no.
Write a program that calculate the no of prime no,even and odd no.
 
#includeiostream struct node {    char value;    struct no.pdf
#includeiostream struct node {    char value;    struct no.pdf#includeiostream struct node {    char value;    struct no.pdf
#includeiostream struct node {    char value;    struct no.pdf
 
Lab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docxLab Week 2 Game Programming.docx
Lab Week 2 Game Programming.docx
 
Bubble in link list
Bubble in link listBubble in link list
Bubble in link list
 
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdfDoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
DoublyList-cpp- #include -DoublyList-h- using namespace std- void Doub.pdf
 
C++ Program to Implement Singly Linked List #includei.pdf
  C++ Program to Implement Singly Linked List  #includei.pdf  C++ Program to Implement Singly Linked List  #includei.pdf
C++ Program to Implement Singly Linked List #includei.pdf
 
#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx#include stdafx.h #include iostream using namespace std;vo.docx
#include stdafx.h #include iostream using namespace std;vo.docx
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docxreverse the linked list (2-4-8-10) by- stack- iteration- recursion-  U.docx
reverse the linked list (2-4-8-10) by- stack- iteration- recursion- U.docx
 
Answer#include iostream using namespace std;struct NodeType.pdf
Answer#include iostream using namespace std;struct NodeType.pdfAnswer#include iostream using namespace std;struct NodeType.pdf
Answer#include iostream using namespace std;struct NodeType.pdf
 
Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
Solutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structuresSolutionsfor co2 C Programs for data structures
Solutionsfor co2 C Programs for data structures
 
In C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdfIn C++ I need help with this method that Im trying to write fillLi.pdf
In C++ I need help with this method that Im trying to write fillLi.pdf
 
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdfAssignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
Assignment isPage 349-350 #4 and #5 Use the Linked List lab.pdf
 

Dernier

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Dernier (20)

A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 

Doubly linklist

  • 1. Task: Define doubly linked . code: #include "stdafx.h" #include<conio.h> #include<iostream> using namespace std; class double_linklist { private: struct node { int data; node *prev; node *next; }*p; int c; public: double_linklist() { p=NULL; c=0; } bool isempty() { return(p==NULL); } void addatbeg(int num) { c++; node *n; n=new node; n->data=num; n->prev=NULL; if(p==NULL) { n->next=NULL; p=n; } else { n->next=p; p->prev=n; p=n; }} void addatend(int num) { c++;
  • 2. node *n; n=new node; n->data=num; n->next=NULL; if(p==NULL) { n->prev=NULL; p=n; } else { node *temp=p; while(temp->next!=NULL) { temp=temp->next; } n->prev=temp; temp->next=n; } } void addafter(int num,int location) { if(isempty()) cout<<"Doubly link list is empty!!!"<<endl; else if(c<location) cout<<"Location not found!!!"<<endl; else { c++; node *n,*temp=p; n=new node; n->data=num; while(1<location) { temp=temp->next; location--; } temp->next->prev=n; n->next=temp->next; temp->next=n; n->prev=temp;}} void del(int num) { if(isempty()) cout<<"Doubly link list is empty!!!"<<endl; else { node *temp=p; while(temp!=NULL) {
  • 3. if(temp->data==num) { if(temp==p) { if(c==1) p=NULL; else temp=p=p->next; p->prev=NULL; } else if(temp->next==NULL) { temp->prev->next=NULL; } else { temp->next->prev=temp->prev; temp->prev->next=temp->next; } c--; } temp=temp->next;}}} void display() { if(p==NULL) cout<<"Doubly link list is empty!!!"<<endl; else { node *temp=p; cout<<"Doubly link list elements are : "<<endl; while(temp!=NULL) { cout<<temp->data<<" "; temp=temp->next;}}} void count() { cout<<"Total no of nodes is : "<<c<<endl; } ~double_llist() { node *temp; while(p!=NULL) { temp=p; p=p->next; delete temp;}}}; int _tmain(int argc, _TCHAR* argv[]) { double_llist d_linkllist; int c,num,location;
  • 4. while(1) { cout<<"nDoubly linked list menu : "<<endl; cout<<"n1.add at end of listn2.add at beginning of listn3.add after specific in listn4.del from the list"; cout<<"n5.display the listn6.count total nodes of the listn7.exit"<<endl; cout<<"Enter your choice : "; cin>>c; switch(c) { case 1: { cout<<"Enter value : "; cin>>num; d_llist.addatend(num); break; } case 2: { cout<<"Enter value : "; cin>>num; d_llist.addatbeg(num); break; } case 3: { cout<<"Enter value : "; cin>>num; cout<<"Enter location after which you want to enter value : "; cin>>location; d_llist.addafter(num,location); break; } case 4: { cout<<"Enter value : "; cin>>num; d_llist.del(num); break; } case 5: { d_llist.display(); break; } case 6: { d_llist.count(); break;
  • 5. } case 7: { cout<<"You are exiting....."<<endl; system("pause"); exit(0); break; } default: cout<<"Invalid choice!!!"<<endl;}} system("pause"); return 0;} Output: