Question: This assignment should be complete in C++ code The starter code provided implements a singly-linked list. However, as a singly-linked list, it lacks any ability

This assignment should be complete in C++ code

The starter code provided implements a singly-linked list. However, as a singly-linked list, it lacks any ability to push or pop items at the back of the list. This is inconvenient. Please modify this data structure to so it is a doubly-linked list.

To Do: Node.h

  • Add a pointer to the previous Node (1pt)

  • Add the ability to get the previous Node (1pt)

  • Add the ability to set the previous Node pointer (1pt)

To Do: LinkedList.h

  • Add a pointer to the tail, the last item in the list (1pt)

  • Create a method to push items onto the back of the list (3 pts)

  • Create a method to pop items off of the back of the list (3pts)

To Do: main.cpp

  • Demonstrate that your pushBack and popBack methods work (2 pts)

    Make sure you include comments

    The starter code is listed bellow

    #include #include "LinkedList.h" int main() { LinkedList myList; for(int i = 0; i < 10; i++) { myList.pushFront(i+1); } myList.print(); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!