Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please make two files, 1) DoublyList.hpp 2) DoublyList.tpp Please read the instructions carefully below; its for C++ This class will represent the data structure. Since

Please make two files,
1) DoublyList.hpp
2) DoublyList.tpp
Please read the instructions carefully below;
its for C++ image text in transcribed
image text in transcribed
image text in transcribed
This class will represent the data structure. Since we want this data structure to be generic, you need to make it a class template. Create two files for this class: a header file (DoublyListhpp) and an implementation file (DoublyList.tpp). Place the header file in the include directory and the implementation file in the src directory. It needs to inherit from the Unsortedi ist class using the public access specifier. Use the following UML diagram to guide you on what this class will need: The following are general notes and reminders. It is suggested that you refer back to the lab 5 solution as a guide. Just like the singly linked list, this version relies on the Node structure Remember that this time the Node needs to have two pointers linking to its next and previous neighbors - You need to allocate memory for both the header and trailer pointers in the constructors - When the list is empty (no elements), that means the header and trailer are connected directly to each other - When clearing the list, the header and trailer are not removed - You only release memory for the header and trailer in the destructor, not in clear - For any method that has position as an argument, you need to optimize the search by starting from the best direction - The following methods need to throw a string error message when its unable to perform its action getElement insert renove - removevalue - replace If you want to create additional helper methods, that's fine. I encourage you to begin by creating a skeleton of the data structure. That way, you can at least build the program without errors. Your methods need to have the following asymptotic time complexities: - O(1) - append(const T8) - Doubly(ist() - gettength() - Isempty() - O(n) clear() copy(const Doublyust8 ) clear() copy(const Doublylist\&) Doublylist (const Doublylist & ) getElement(int) insert (int, const T\&) operator = (const DoublyList &) remove(int) removeValue (const T\&) replace(int, const T\&) search (const T\&) - DoublyList()

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions