SlideShare ist ein Scribd-Unternehmen logo
1 von 4
To support this add the following functions to each of DList and Sentinel classes:
These functions returns an iterator/const_iterator to the first node in the list, end() if list is empty.
these functions returns an iterator/const_iterator to the node just after the last node in the linked
list.
Iterator/const_iterator classes
The const_iterator and iterators must support the following operations:
iterator advances to next node in list if iterator is not currently at end(). The iterator returned
depends if it is prefix or postfix. prefix operator returns iterator to current node. postfix operator
returns iterator to node before the increment.
iterator refer to the node "previous" to the linked list. The iterator returned depends if it is prefix
or postfix. prefix operator returns iterator to current node. postfix operator returns iterator to
node before the decrement.
returns a const reference to data in the node referred to by the iterator.
returns a reference to data in the node referred to by the iterator.
Please implement iterator and const_iterator for both the functions DList and Sentinel classes
in C++ code language , thank you!
#include
<iostream>
template <typename T>
class DList{
struct Node{
T data_;
Node* next_;
Node* prev_;
Node(const T& data=T{},Node* next=nullptr, Node* prev=nullptr){
data_=data;
next_=next;
prev_=prev;
}
};
Node* front_;
Node* back_;
public:
DList(){
front_=nullptr;
back_=nullptr;
}
void push_front(const T& data);
~DList();
class const_iterator{
Node* curr_;
const_iterator(Node* n){
curr_=n;
}
public:
const_iterator(){
curr_=nullptr;
}
const_iterator& operator++(){}
const_iterator operator++(int){}
const_iterator& operator--(){}
const_iterator operator--(int){}
bool operator==(const_iterator rhs){}
bool operator!=(const_iterator rhs){}
const T& operator*()const{}
};
class iterator:public const_iterator{
public:
iterator();
iterator& operator++(){}
iterator operator++(int){}
iterator& operator--(){}
iterator operator--(int){}
T& operator*(){}
const T& operator*()const{}
};
const_iterator cbegin() const{ }
iterator begin(){ }
const_iterator cend() const{}
iterator end(){}
};
template <typename T>
void DList<T>::push_front(const T& data){
}
template <typename T>
DList<T>::~DList(){
}
template <typename T>
class Sentinel{
struct Node{
T data_;
Node* next_;
Node* prev_;
Node(const T& data=T{},Node* next=nullptr, Node* prev=nullptr){
data_=data;
next_=next;
prev_=prev;
}
};
Node* front_;
Node* back_;
public:
Sentinel(){
front_=new Node();
back_=new Node();
front_->next_=back_;
back_->prev_=front_;
}
void push_front(const T& data);
~Sentinel();
class const_iterator{
public:
const_iterator(){}
const_iterator& operator++(){}
const_iterator operator++(int){}
const_iterator& operator--(){}
const_iterator operator--(int){}
bool operator==(const_iterator rhs){}
bool operator!=(const_iterator rhs){}
const T& operator*()const{}
};
class iterator:public const_iterator{
public:
iterator();
iterator& operator++(){}
iterator operator++(int){}
iterator& operator--(){}
iterator operator--(int){}
T& operator*(){}
const T& operator*()const{}
};
const_iterator cbegin() const{}
iterator begin(){}
const_iterator cend() const{}
iterator end(){}
};
template <typename T>
void Sentinel<T>::push_front(const T& data){
}
template <typename T>
Sentinel<T>::~Sentinel(){
}

Weitere ähnliche Inhalte

Ähnlich wie To support this add the following functions to each of DList and Senti.docx

Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
info114
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
callawaycorb73779
 
SeriesTester.classpathSeriesTester.project SeriesT.docx
SeriesTester.classpathSeriesTester.project  SeriesT.docxSeriesTester.classpathSeriesTester.project  SeriesT.docx
SeriesTester.classpathSeriesTester.project SeriesT.docx
lesleyryder69361
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
aathmiboutique
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Edwardw5nSlaterl
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
stopgolook
 
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdfPlease code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
farankureshi
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
EricvtJFraserr
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdf
sales98
 
In this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdfIn this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdf
contact41
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdf
ankit11134
 

Ähnlich wie To support this add the following functions to each of DList and Senti.docx (20)

C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdfNeed done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
Need done for Date Structures please! 4-18 LAB- Sorted number list imp.pdf
 
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdfC++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
C++ problemPart 1 Recursive Print (40 pts)Please write the recu.pdf
 
C1320prespost
C1320prespostC1320prespost
C1320prespost
 
SeriesTester.classpathSeriesTester.project SeriesT.docx
SeriesTester.classpathSeriesTester.project  SeriesT.docxSeriesTester.classpathSeriesTester.project  SeriesT.docx
SeriesTester.classpathSeriesTester.project SeriesT.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
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... Functions
 
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdfNeed Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
Need Help!! C++ #include-iostream- #include-linkedlist-h- using namesp.pdf
 
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdfIn C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
In C++ please, do not alter node.hStep 1 Inspect the Node.h file.pdf
 
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdfPlease code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdf
 
In this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdfIn this lab, we will write an application to store a deck of cards i.pdf
In this lab, we will write an application to store a deck of cards i.pdf
 
Overloading
OverloadingOverloading
Overloading
 
Savitch ch 18
Savitch ch 18Savitch ch 18
Savitch ch 18
 
C++ FUNCTIONS-1.pptx
C++ FUNCTIONS-1.pptxC++ FUNCTIONS-1.pptx
C++ FUNCTIONS-1.pptx
 
C++ FUNCTIONS-1.pptx
C++ FUNCTIONS-1.pptxC++ FUNCTIONS-1.pptx
C++ FUNCTIONS-1.pptx
 
Linked List.pptx
Linked List.pptxLinked List.pptx
Linked List.pptx
 
Please help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdfPlease help solve this in C++ So the program is working fin.pdf
Please help solve this in C++ So the program is working fin.pdf
 

Mehr von jobesshirley

U-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
U-S- Senate-The file Senate113-txt contains the members of the 113 th.docxU-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
U-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
jobesshirley
 
Two Types of Data for Constructing Trees There are two major different.docx
Two Types of Data for Constructing Trees There are two major different.docxTwo Types of Data for Constructing Trees There are two major different.docx
Two Types of Data for Constructing Trees There are two major different.docx
jobesshirley
 

Mehr von jobesshirley (20)

Use the magnitudes (Richter scale) of the earthquakes listed in the da.docx
Use the magnitudes (Richter scale) of the earthquakes listed in the da.docxUse the magnitudes (Richter scale) of the earthquakes listed in the da.docx
Use the magnitudes (Richter scale) of the earthquakes listed in the da.docx
 
Use the joint distribution of random variables X and Y to compute P(X-.docx
Use the joint distribution of random variables X and Y to compute P(X-.docxUse the joint distribution of random variables X and Y to compute P(X-.docx
Use the joint distribution of random variables X and Y to compute P(X-.docx
 
Use the image below to answer questions 2-3- As part of his series of.docx
Use the image below to answer questions 2-3- As part of his series of.docxUse the image below to answer questions 2-3- As part of his series of.docx
Use the image below to answer questions 2-3- As part of his series of.docx
 
Use the following figure to answer the question- The figurolshows the.docx
Use the following figure to answer the question- The figurolshows the.docxUse the following figure to answer the question- The figurolshows the.docx
Use the following figure to answer the question- The figurolshows the.docx
 
Use the drop-down menu to indicate if each element is a part of APA St.docx
Use the drop-down menu to indicate if each element is a part of APA St.docxUse the drop-down menu to indicate if each element is a part of APA St.docx
Use the drop-down menu to indicate if each element is a part of APA St.docx
 
Use the figure below to answer questions 1-7- Nodes on this tree areAp.docx
Use the figure below to answer questions 1-7- Nodes on this tree areAp.docxUse the figure below to answer questions 1-7- Nodes on this tree areAp.docx
Use the figure below to answer questions 1-7- Nodes on this tree areAp.docx
 
Use Table 1 in Appendix to find the following- a) P(X-12) for n-20-p-0.docx
Use Table 1 in Appendix to find the following- a) P(X-12) for n-20-p-0.docxUse Table 1 in Appendix to find the following- a) P(X-12) for n-20-p-0.docx
Use Table 1 in Appendix to find the following- a) P(X-12) for n-20-p-0.docx
 
Use Figure p7-1 for the following questions 1- Write the SQL code re.docx
Use Figure p7-1 for the following questions   1- Write the SQL code re.docxUse Figure p7-1 for the following questions   1- Write the SQL code re.docx
Use Figure p7-1 for the following questions 1- Write the SQL code re.docx
 
urrent Attempt in Progress Identify which of the following statements.docx
urrent Attempt in Progress Identify which of the following statements.docxurrent Attempt in Progress Identify which of the following statements.docx
urrent Attempt in Progress Identify which of the following statements.docx
 
Under what conditions would the cash method of accounting be advantage.docx
Under what conditions would the cash method of accounting be advantage.docxUnder what conditions would the cash method of accounting be advantage.docx
Under what conditions would the cash method of accounting be advantage.docx
 
U-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
U-S- Senate-The file Senate113-txt contains the members of the 113 th.docxU-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
U-S- Senate-The file Senate113-txt contains the members of the 113 th.docx
 
Undertaking FDI- by definition- means not investing in the MNE's home.docx
Undertaking FDI- by definition- means not investing in the MNE's home.docxUndertaking FDI- by definition- means not investing in the MNE's home.docx
Undertaking FDI- by definition- means not investing in the MNE's home.docx
 
Two parents are carriers for the sickle cell trait- which exhibits cla.docx
Two parents are carriers for the sickle cell trait- which exhibits cla.docxTwo parents are carriers for the sickle cell trait- which exhibits cla.docx
Two parents are carriers for the sickle cell trait- which exhibits cla.docx
 
Two Types of Data for Constructing Trees There are two major different.docx
Two Types of Data for Constructing Trees There are two major different.docxTwo Types of Data for Constructing Trees There are two major different.docx
Two Types of Data for Constructing Trees There are two major different.docx
 
Two public corporations- First Engineering and Midwest Development- ea.docx
Two public corporations- First Engineering and Midwest Development- ea.docxTwo public corporations- First Engineering and Midwest Development- ea.docx
Two public corporations- First Engineering and Midwest Development- ea.docx
 
Two major components make up cell membranes- molecul.docx
Two major components make up cell membranes-                   molecul.docxTwo major components make up cell membranes-                   molecul.docx
Two major components make up cell membranes- molecul.docx
 
Two international banks are integrating two financial processing softw (2).docx
Two international banks are integrating two financial processing softw (2).docxTwo international banks are integrating two financial processing softw (2).docx
Two international banks are integrating two financial processing softw (2).docx
 
Two independent simple random samples are taken to test the difference.docx
Two independent simple random samples are taken to test the difference.docxTwo independent simple random samples are taken to test the difference.docx
Two independent simple random samples are taken to test the difference.docx
 
Tummy Foods purchased a two-year fire and extended coverage insurance.docx
Tummy Foods purchased a two-year fire and extended coverage insurance.docxTummy Foods purchased a two-year fire and extended coverage insurance.docx
Tummy Foods purchased a two-year fire and extended coverage insurance.docx
 
TTYL Corp expects 2021 sales to be $125 million- In 2020- TTYL had $11.docx
TTYL Corp expects 2021 sales to be $125 million- In 2020- TTYL had $11.docxTTYL Corp expects 2021 sales to be $125 million- In 2020- TTYL had $11.docx
TTYL Corp expects 2021 sales to be $125 million- In 2020- TTYL had $11.docx
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 

To support this add the following functions to each of DList and Senti.docx

  • 1. To support this add the following functions to each of DList and Sentinel classes: These functions returns an iterator/const_iterator to the first node in the list, end() if list is empty. these functions returns an iterator/const_iterator to the node just after the last node in the linked list. Iterator/const_iterator classes The const_iterator and iterators must support the following operations: iterator advances to next node in list if iterator is not currently at end(). The iterator returned depends if it is prefix or postfix. prefix operator returns iterator to current node. postfix operator returns iterator to node before the increment. iterator refer to the node "previous" to the linked list. The iterator returned depends if it is prefix or postfix. prefix operator returns iterator to current node. postfix operator returns iterator to node before the decrement. returns a const reference to data in the node referred to by the iterator. returns a reference to data in the node referred to by the iterator. Please implement iterator and const_iterator for both the functions DList and Sentinel classes in C++ code language , thank you! #include <iostream> template <typename T> class DList{ struct Node{ T data_; Node* next_; Node* prev_; Node(const T& data=T{},Node* next=nullptr, Node* prev=nullptr){ data_=data; next_=next; prev_=prev; } }; Node* front_; Node* back_; public:
  • 2. DList(){ front_=nullptr; back_=nullptr; } void push_front(const T& data); ~DList(); class const_iterator{ Node* curr_; const_iterator(Node* n){ curr_=n; } public: const_iterator(){ curr_=nullptr; } const_iterator& operator++(){} const_iterator operator++(int){} const_iterator& operator--(){} const_iterator operator--(int){} bool operator==(const_iterator rhs){} bool operator!=(const_iterator rhs){} const T& operator*()const{} }; class iterator:public const_iterator{ public: iterator(); iterator& operator++(){} iterator operator++(int){} iterator& operator--(){} iterator operator--(int){} T& operator*(){} const T& operator*()const{} }; const_iterator cbegin() const{ } iterator begin(){ } const_iterator cend() const{} iterator end(){}
  • 3. }; template <typename T> void DList<T>::push_front(const T& data){ } template <typename T> DList<T>::~DList(){ } template <typename T> class Sentinel{ struct Node{ T data_; Node* next_; Node* prev_; Node(const T& data=T{},Node* next=nullptr, Node* prev=nullptr){ data_=data; next_=next; prev_=prev; } }; Node* front_; Node* back_; public: Sentinel(){ front_=new Node(); back_=new Node(); front_->next_=back_; back_->prev_=front_; } void push_front(const T& data); ~Sentinel(); class const_iterator{ public: const_iterator(){} const_iterator& operator++(){} const_iterator operator++(int){} const_iterator& operator--(){}
  • 4. const_iterator operator--(int){} bool operator==(const_iterator rhs){} bool operator!=(const_iterator rhs){} const T& operator*()const{} }; class iterator:public const_iterator{ public: iterator(); iterator& operator++(){} iterator operator++(int){} iterator& operator--(){} iterator operator--(int){} T& operator*(){} const T& operator*()const{} }; const_iterator cbegin() const{} iterator begin(){} const_iterator cend() const{} iterator end(){} }; template <typename T> void Sentinel<T>::push_front(const T& data){ } template <typename T> Sentinel<T>::~Sentinel(){ }