Question: I need help with this. Implement LinkedList class specified in list.h in list.cpp. //NEED list.cpp //put your implementation of LinkedList class here GIVEN: list.h #include

I need help with this.

Implement LinkedList class specified in list.h in list.cpp.

//NEED

list.cpp

//put your implementation of LinkedList class here

GIVEN:

list.h

#include "list.h"

int main() { LinkedList aList;

aList.add(3); aList.add(10); aList.add(1); aList.add(7); aList.add(9); aList.add(12); aList.printAscending(); aList.printDescending(); aList.remove(3); aList.remove(1); aList.remove(7); aList.remove(12); aList.printAscending(); aList.printDescending();

return 0; }

GIVEN:

app.cpp

#ifndef LIST_H #define LIST_H

#include using namespace std;

class LinkedList { private: struct Node { int data; Node * next; Node * prev; }; Node * head, * tail; public: LinkedList(); bool add(int val); bool remove(int val); void printAscending() const; void printDescending() const; };

#endif

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!