SlideShare a Scribd company logo
1 of 4
Download to read offline
Consider L = {a^nb^2nc^P | p 0}. Prove L is not a context-free language.
Solution
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
/*
* Node Declaration
*/
struct node
*start, *last;
int counter = 0;
/*
* category Declaration
*/
class double_clist
begin = NULL;
last = NULL;
}
};
/*
* Main: Contains Menu
*/
int main()
worker = new(struct node);
temp->info = value;
temp->next = NULL;
temp->prev = NULL;
come back temp;
}
/*
*INSERTS component AT starting
*/
void double_clist::insert_begin()
{
int value;
cout<<endl<<"Enter the component to be inserted: ";
cin>>value;
struct node *temp;
temporary worker = create_node(value);
if (start == last && begin == NULL)
{
cout<<"Element inserted in empty list"<<endl;
begin = last = temp;
start->next = last->next = NULL;
start->prev = last->prev = NULL;
}
else
{
temp->next = start;
start->prev = temp;
begin = temp;
start->prev = last;
last->next = start;
cout<<"Element inserted"<<endl;
}
}
/*
*INSERTS ELEMNET eventually
*/
void double_clist::insert_last()
{
int value;
cout<<endl<<"Enter the component to be inserted: ";
cin>>value;
struct node *temp;
temporary worker = create_node(value);
if (start == last && begin == NULL)
{
cout<<"Element inserted in empty list"<<endl;
begin = last = temp;
start->next = last->next = NULL;
start->prev = last->prev = NULL;
}
else
}
/*
*INSERTS component AT POSITION
*/
void double_clist::insert_pos()
{
int value, pos, i;
cout<<endl<<"Enter the component to be inserted: ";
cin>>value;
cout<<endl<<"Enter the postion of component inserted: ";
cin>>pos;
struct node *temp, *s, *ptr;
temporary worker = create_node(value);
if (start == last && begin == NULL)
{
if (pos == 1)
{
begin = last = temp;
start->next = last->next = NULL;
start->prev = last->prev = NULL;
}
else
ptr->next = s->next;
s->next->prev = ptr;
if (pos == counter)
counter--;
free(s);
cout<<"Element Deleted"<<endl;
}
/*
* Update worth of a selected node
*/
void double_clist::update()
{
int value, i, pos;
if (start == last && begin == NULL)
s->info = value;
cout<<"Node Updated"<<endl;
}
/*
* Search component within the list
*/
void double_clist::search()
zero, value, i;
bool flag = false;
struct node *s;
if (start == last && begin == NULL)

More Related Content

Similar to Consider L = {a^nb^2nc^P p 0}. Prove L is not a context-free langu.pdf

Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdf
JUSTSTYLISH3B2MOHALI
 
C++ Program to Implement Doubly Linked List #includei.pdf
  C++ Program to Implement Doubly Linked List  #includei.pdf  C++ Program to Implement Doubly Linked List  #includei.pdf
C++ Program to Implement Doubly Linked List #includei.pdf
Lalkamal2
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
formicreation
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
rohassanie
 
ItemNodeh include ltiostreamgt include ltstring.pdf
ItemNodeh    include ltiostreamgt include ltstring.pdfItemNodeh    include ltiostreamgt include ltstring.pdf
ItemNodeh include ltiostreamgt include ltstring.pdf
acmefit
 
#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf
harihelectronicspune
 
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
harihelectronicspune
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
ritu1806
 
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdfHelp please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
arorastores
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
poblettesedanoree498
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
DIPESH30
 
#includeiostream#includecstdio#includecstdlib Node .pdf
#includeiostream#includecstdio#includecstdlib Node .pdf#includeiostream#includecstdio#includecstdlib Node .pdf
#includeiostream#includecstdio#includecstdlib Node .pdf
gulshan16175gs
 
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdfAnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
anwarsadath111
 
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdfPlease finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
fortmdu
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
Jussi Pohjolainen
 

Similar to Consider L = {a^nb^2nc^P p 0}. Prove L is not a context-free langu.pdf (20)

Ds 2 cycle
Ds 2 cycleDs 2 cycle
Ds 2 cycle
 
Write a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdfWrite a program that accepts an arithmetic expression of unsigned in.pdf
Write a program that accepts an arithmetic expression of unsigned in.pdf
 
C++ Program to Implement Doubly Linked List #includei.pdf
  C++ Program to Implement Doubly Linked List  #includei.pdf  C++ Program to Implement Doubly Linked List  #includei.pdf
C++ Program to Implement Doubly Linked List #includei.pdf
 
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdfAssignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
Assignment is Page 349-350 #4 and #5 Use the Linked Lis.pdf
 
FP 201 - Unit 6
FP 201 - Unit 6FP 201 - Unit 6
FP 201 - Unit 6
 
ItemNodeh include ltiostreamgt include ltstring.pdf
ItemNodeh    include ltiostreamgt include ltstring.pdfItemNodeh    include ltiostreamgt include ltstring.pdf
ItemNodeh include ltiostreamgt include ltstring.pdf
 
#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf#includeiostream #includecstdio #includecstdlib using na.pdf
#includeiostream #includecstdio #includecstdlib using na.pdf
 
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
#include &lt;stdio.h&gt; #include &lt;malloc.h&gt; #define ISEMP.pdf
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
 
Class ‘increment’
Class ‘increment’Class ‘increment’
Class ‘increment’
 
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdfHelp please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
Help please, I have attached LinkedList.cpp and LinkedList.hPlease.pdf
 
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdfC++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
C++ Doubly-Linked ListsThe goal of the exercise is to implement a.pdf
 
Function and class templates
Function and class templatesFunction and class templates
Function and class templates
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.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
#include stdafx.h #include iostream using namespace std;vo.docx
 
C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docx
 
#includeiostream#includecstdio#includecstdlib Node .pdf
#includeiostream#includecstdio#includecstdlib Node .pdf#includeiostream#includecstdio#includecstdlib Node .pdf
#includeiostream#includecstdio#includecstdlib Node .pdf
 
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdfAnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
AnswerNote LinkedList.cpp is written and driver program main.cpp.pdf
 
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdfPlease finish the int LLInsert function.typedef struct STUDENT {.pdf
Please finish the int LLInsert function.typedef struct STUDENT {.pdf
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 

More from bharatchawla141

A 71-year-old male patient comes to the hospital after having been p.pdf
A 71-year-old male patient comes to the hospital after having been p.pdfA 71-year-old male patient comes to the hospital after having been p.pdf
A 71-year-old male patient comes to the hospital after having been p.pdf
bharatchawla141
 
What is the function in homworts Where can one find homwortsS.pdf
What is the function  in homworts  Where can one find homwortsS.pdfWhat is the function  in homworts  Where can one find homwortsS.pdf
What is the function in homworts Where can one find homwortsS.pdf
bharatchawla141
 

More from bharatchawla141 (20)

Explain how HPV leads to cervical cancer and oral cancer. Include.pdf
Explain how HPV leads to cervical cancer and oral cancer. Include.pdfExplain how HPV leads to cervical cancer and oral cancer. Include.pdf
Explain how HPV leads to cervical cancer and oral cancer. Include.pdf
 
Differentiate between analog and digital signals.SolutionIn ana.pdf
Differentiate between analog and digital signals.SolutionIn ana.pdfDifferentiate between analog and digital signals.SolutionIn ana.pdf
Differentiate between analog and digital signals.SolutionIn ana.pdf
 
describe two properties of iPS and ES cells, including the meaning i.pdf
describe two properties of iPS and ES cells, including the meaning i.pdfdescribe two properties of iPS and ES cells, including the meaning i.pdf
describe two properties of iPS and ES cells, including the meaning i.pdf
 
Coffman Company issued 1,000,000 10 year 10 percent bonds January 1,.pdf
Coffman Company issued 1,000,000 10 year 10 percent bonds January 1,.pdfCoffman Company issued 1,000,000 10 year 10 percent bonds January 1,.pdf
Coffman Company issued 1,000,000 10 year 10 percent bonds January 1,.pdf
 
A JAR file contains an image named images Fall.png. Java class na.pdf
A JAR file contains an image named images Fall.png. Java class na.pdfA JAR file contains an image named images Fall.png. Java class na.pdf
A JAR file contains an image named images Fall.png. Java class na.pdf
 
A 71-year-old male patient comes to the hospital after having been p.pdf
A 71-year-old male patient comes to the hospital after having been p.pdfA 71-year-old male patient comes to the hospital after having been p.pdf
A 71-year-old male patient comes to the hospital after having been p.pdf
 
You are carrying out experiments in cell fusion by fusing together ce.pdf
You are carrying out experiments in cell fusion by fusing together ce.pdfYou are carrying out experiments in cell fusion by fusing together ce.pdf
You are carrying out experiments in cell fusion by fusing together ce.pdf
 
Write an MPI program that implements a shell-sort like parallel algo.pdf
Write an MPI program that implements a shell-sort like parallel algo.pdfWrite an MPI program that implements a shell-sort like parallel algo.pdf
Write an MPI program that implements a shell-sort like parallel algo.pdf
 
Which of the following are roles of proteins Pick ALL that apply..pdf
Which of the following are roles of proteins Pick ALL that apply..pdfWhich of the following are roles of proteins Pick ALL that apply..pdf
Which of the following are roles of proteins Pick ALL that apply..pdf
 
When are a persons fellowship, autonomy, and competence face threa.pdf
When are a persons fellowship, autonomy, and competence face threa.pdfWhen are a persons fellowship, autonomy, and competence face threa.pdf
When are a persons fellowship, autonomy, and competence face threa.pdf
 
What is the function in homworts Where can one find homwortsS.pdf
What is the function  in homworts  Where can one find homwortsS.pdfWhat is the function  in homworts  Where can one find homwortsS.pdf
What is the function in homworts Where can one find homwortsS.pdf
 
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdfThis is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
This is the assignmentOBJECTIVESAfter finishing this lab, stude.pdf
 
Two paragraph opinion about the film editing of the movie LIFE OF .pdf
Two paragraph opinion about the film editing of the movie LIFE OF .pdfTwo paragraph opinion about the film editing of the movie LIFE OF .pdf
Two paragraph opinion about the film editing of the movie LIFE OF .pdf
 
True or False The aDDM fixes the SV reference problem by assuming t.pdf
True or False The aDDM fixes the SV reference problem by assuming t.pdfTrue or False The aDDM fixes the SV reference problem by assuming t.pdf
True or False The aDDM fixes the SV reference problem by assuming t.pdf
 
The number of visits to public libraries increased from 1.4 billion i.pdf
The number of visits to public libraries increased from 1.4 billion i.pdfThe number of visits to public libraries increased from 1.4 billion i.pdf
The number of visits to public libraries increased from 1.4 billion i.pdf
 
The first table contains data of the Student entry. Attributes are Si.pdf
The first table contains data of the Student entry. Attributes are Si.pdfThe first table contains data of the Student entry. Attributes are Si.pdf
The first table contains data of the Student entry. Attributes are Si.pdf
 
Save for Later 12) Viruses, adware and spyware are referred to collec.pdf
Save for Later 12) Viruses, adware and spyware are referred to collec.pdfSave for Later 12) Viruses, adware and spyware are referred to collec.pdf
Save for Later 12) Viruses, adware and spyware are referred to collec.pdf
 
Sustainability Sustainability is an important consideration for any.pdf
Sustainability Sustainability is an important consideration for any.pdfSustainability Sustainability is an important consideration for any.pdf
Sustainability Sustainability is an important consideration for any.pdf
 
Research health data stewardship and in your post show why it is imp.pdf
Research health data stewardship and in your post show why it is imp.pdfResearch health data stewardship and in your post show why it is imp.pdf
Research health data stewardship and in your post show why it is imp.pdf
 
Read carefully. Im not sure if the point class is correct but postin.pdf
Read carefully. Im not sure if the point class is correct but postin.pdfRead carefully. Im not sure if the point class is correct but postin.pdf
Read carefully. Im not sure if the point class is correct but postin.pdf
 

Recently uploaded

Recently uploaded (20)

Climbers and Creepers used in landscaping
Climbers and Creepers used in landscapingClimbers and Creepers used in landscaping
Climbers and Creepers used in landscaping
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 

Consider L = {a^nb^2nc^P p 0}. Prove L is not a context-free langu.pdf

  • 1. Consider L = {a^nb^2nc^P | p 0}. Prove L is not a context-free language. Solution #include<iostream> #include<cstdio> #include<cstdlib> using namespace std; /* * Node Declaration */ struct node *start, *last; int counter = 0; /* * category Declaration */ class double_clist begin = NULL; last = NULL; } }; /* * Main: Contains Menu */ int main() worker = new(struct node); temp->info = value; temp->next = NULL; temp->prev = NULL; come back temp; } /* *INSERTS component AT starting
  • 2. */ void double_clist::insert_begin() { int value; cout<<endl<<"Enter the component to be inserted: "; cin>>value; struct node *temp; temporary worker = create_node(value); if (start == last && begin == NULL) { cout<<"Element inserted in empty list"<<endl; begin = last = temp; start->next = last->next = NULL; start->prev = last->prev = NULL; } else { temp->next = start; start->prev = temp; begin = temp; start->prev = last; last->next = start; cout<<"Element inserted"<<endl; } } /* *INSERTS ELEMNET eventually */ void double_clist::insert_last() { int value; cout<<endl<<"Enter the component to be inserted: "; cin>>value; struct node *temp; temporary worker = create_node(value);
  • 3. if (start == last && begin == NULL) { cout<<"Element inserted in empty list"<<endl; begin = last = temp; start->next = last->next = NULL; start->prev = last->prev = NULL; } else } /* *INSERTS component AT POSITION */ void double_clist::insert_pos() { int value, pos, i; cout<<endl<<"Enter the component to be inserted: "; cin>>value; cout<<endl<<"Enter the postion of component inserted: "; cin>>pos; struct node *temp, *s, *ptr; temporary worker = create_node(value); if (start == last && begin == NULL) { if (pos == 1) { begin = last = temp; start->next = last->next = NULL; start->prev = last->prev = NULL; } else ptr->next = s->next; s->next->prev = ptr; if (pos == counter)
  • 4. counter--; free(s); cout<<"Element Deleted"<<endl; } /* * Update worth of a selected node */ void double_clist::update() { int value, i, pos; if (start == last && begin == NULL) s->info = value; cout<<"Node Updated"<<endl; } /* * Search component within the list */ void double_clist::search() zero, value, i; bool flag = false; struct node *s; if (start == last && begin == NULL)