Question: Assignment #3 DikdBag Class Methods Credit 10 pts, Due Friday 3/5/21 Given two classes Dnode (for doubly linked node) and DikdBag (for doubly linked bag)

 Assignment #3 DikdBag Class Methods Credit 10 pts, Due Friday 3/5/21Given two classes Dnode (for doubly linked node) and DikdBag (for doubly

Assignment #3 DikdBag Class Methods Credit 10 pts, Due Friday 3/5/21 Given two classes Dnode (for doubly linked node) and DikdBag (for doubly linked bag) below: // Dnode: doubly linked node template class Dnode T item; Dnode* next; Dnode* prev; public: Dnode (): next (nullptr), prev (nullptr) { } Dnode (const T& anItem): next (nullptr), prev (nullptr), item (anItem) { } Dnode (const T& anItem, Dnode* nn, Dnode* pn): next (nn), prev (pn), item(anItem) { } void setItem(const T& anItem) { item = anItem; } void setNext (Dnode* nn) { next = nn; } void set Prev (Dnode* pn) { prev = pn; } T getItem() const { return item; } Dnode* getNext() const { return next; } Dnode* getPrev () const { return prev; } // DlkdBag: doubly linked bag template class DlkdBag Dnode* head; Dnode* tail; Dnode* getPtrto (const T& tgt) const; public: DlkdBag():head(nullptr), tail (nullptr) { } DlkdBag (const DikdBag& aBag); int getSize() const; bool addFH(const T& nEntry); // add from head bool addFT (const T& nEntry); // add from tail void clear(); void display() const; bool addFT (const T& nEntry); // add from tail void clear(); void display() const; Please implement these five methods and main function: 1. getSize() // return the total number of items stored in the bag. Note: DlkdBag does not have itemCount member variable. 2. addFH() //add anEntry from head 3. addFT() //add anEntry from tail 4. display() // display bag items from head to tail 5. clear() // get rid of the bag, and release all memory used by the bag 6. main() // driver code to test all the methods you've implemented Submission: Put everything into a single file, name it as LastNameFirstInitial_a3.cpp (e.g., if your name is John Doe, it will be DoeJ_a3.cpp), and then upload it to your blackboard account by the due day

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!