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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started