Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

template class DList { friend class UnitTests _ Lab 3 ; / / Giving access to test code struct Node { / / NOTE: Values

template
class DList {
friend class UnitTests_Lab3; // Giving access to test code
struct Node {
// NOTE: Values set to -1 for unit test purposes
Type data;
Node* next = reinterpret_cast(-1);
Node* prev = reinterpret_cast(-1);
Node(const Type& _data, Node*_next = nullptr, Node*_prev = nullptr){
// TODO: Implement this method
}
};
public:
class Iterator {
public:
Node* mCurr = reinterpret_cast(-1);
Iterator& operator++(){
// TODO: Implement this method
}
Iterator operator++(int){
// TODO: Implement this method
}
Iterator& operator--(){
// TODO: Implement this method
}
Iterator operator--(int){
// TODO: Implement this method
}
Type& operator*(){
// TODO: Implement this method
}
bool operator !=(const Iterator& _iter) const {
return mCurr !=_iter.mCurr;
}
};
// Data members
// NOTE: All values set to -1 for unit test purposes
Node* mHead = reinterpret_cast(-1);
Node* mTail = reinterpret_cast(-1);
size_t mSize =-1;
public:
DList(){
// TODO: Implement this method
}
~DList(){
// TODO: Implement this method
}
DList(const DList& _copy){
// TODO: Implement this method
}
DList& operator=(const DList& _assign){
// TODO: Implement this method
}
void AddHead(const Type& _data){
// TODO: Implement this method
}
void AddTail(const Type& _data){
// TODO: Implement this method
}
void Clear(){
// TODO: Implement this method
}
Iterator Insert(Iterator& _iter, const Type& _data){
// Implement this method
}
Iterator Erase(Iterator& _iter){
// TODO: Implement this method
}
Iterator Begin() const {
// TODO: Implement this method
}
Iterator End() const {
// TODO: Implement this method
}
};

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

What are some connections between Business & Dance?

Answered: 1 week ago