Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions

Question

Which form of proof do you find most persuasive? Why?

Answered: 1 week ago