Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

How would you describe your typical day at work?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago