2) The class definition of a Doubly Linked List class is given below, It contains an attribute called top that represents the top of a doubly linked list, It abo includes one constructor, a print...


Please help with the follow question in C++


2) The class definition of a Doubly Linked List class is given below, It contains an<br>attribute called top that represents the top of a doubly linked list, It abo<br>includes one constructor, a print method that should print the elements of the<br>list in reverse order. It also includes another method that shoukd add a note on<br>the top of the doubly linked list. The constructor is implemented. Your job is to<br>implement the printReverse() and insertOnThe Top(O methods.<br>Note: Please do the implementation on the next page<br>#include<iostream><br>using namespace std;<br>I1-<br>class Node;<br>typedef Node* NodePtr;<br>class Node<br>public:<br>int number;<br>NodePtr next;<br>NodePtr prev;<br>Node(){number 0; next prev NULL:}<br>Node(int n) {number n; next-prev NULL;}<br>3B<br>11--<br>class DoubleLL<br>private:<br>NodePtr top;<br>public:<br>DoubleLL() (top NULL;}<br>void printReverse(%:<br>bool insertOnTheTop (int n);<br>}3;<br>11-<br>

Extracted text: 2) The class definition of a Doubly Linked List class is given below, It contains an attribute called top that represents the top of a doubly linked list, It abo includes one constructor, a print method that should print the elements of the list in reverse order. It also includes another method that shoukd add a note on the top of the doubly linked list. The constructor is implemented. Your job is to implement the printReverse() and insertOnThe Top(O methods. Note: Please do the implementation on the next page #include using namespace std; I1- class Node; typedef Node* NodePtr; class Node public: int number; NodePtr next; NodePtr prev; Node(){number 0; next prev NULL:} Node(int n) {number n; next-prev NULL;} 3B 11-- class DoubleLL private: NodePtr top; public: DoubleLL() (top NULL;} void printReverse(%: bool insertOnTheTop (int n); }3; 11-

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here