SlideShare a Scribd company logo
1 of 8
Download to read offline
Please complete ALL of the TO DOs in this code. I am really struggling with this assignment.
The last time I posted this question, they did not complete them all. Please do it! There are two
files, list.h and queue.h. I tried to complete this on my own and none of it worked, so I am
posting the template again instead of my nonworking code. Please do not use chatgpt, I think the
last person used it.
list.h:
#pragma once
#include // size_t
#include // std::bidirectional_iterator_tag
#include // std::is_same, std::enable_if
template
class List {
private:
struct Node {
Node *next, *prev;
T data;
explicit Node(Node* prev = nullptr, Node* next = nullptr)
: next{next}, prev{prev} {}
explicit Node(const T& data, Node* prev = nullptr, Node* next = nullptr)
: next{next}, prev{prev}, data{data} {}
explicit Node(T&& data, Node* prev = nullptr, Node* next = nullptr)
: next{next}, prev{prev}, data{std::move(data)} {}
};
template
class basic_iterator {
public:
using iterator_category = std::bidirectional_iterator_tag;
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = pointer_type;
using reference = reference_type;
private:
friend class List;
using Node = typename List::Node;
Node* node;
explicit basic_iterator(Node* ptr) noexcept : node{ptr} {}
explicit basic_iterator(const Node* ptr) noexcept : node{const_cast(ptr)} {}
public:
basic_iterator() { /* TODO */ };
basic_iterator(const basic_iterator&) = default;
basic_iterator(basic_iterator&&) = default;
~basic_iterator() = default;
basic_iterator& operator=(const basic_iterator&) = default;
basic_iterator& operator=(basic_iterator&&) = default;
reference operator*() const {
// TODO
}
pointer operator->() const {
// TODO
}
// Prefix Increment: ++a
basic_iterator& operator++() {
// TODO
}
// Postfix Increment: a++
basic_iterator operator++(int) {
// TODO
}
// Prefix Decrement: --a
basic_iterator& operator--() {
// TODO
}
// Postfix Decrement: a--
basic_iterator operator--(int) {
// TODO
}
bool operator==(const basic_iterator& other) const noexcept {
// TODO
}
bool operator!=(const basic_iterator& other) const noexcept {
// TODO
}
};
public:
using value_type = T;
using size_type = size_t;
using difference_type = ptrdiff_t;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = value_type*;
using const_pointer = const value_type*;
using iterator = basic_iterator;
using const_iterator = basic_iterator;
private:
Node head, tail;
size_type _size;
public:
List() {
// TODO - Don't forget to initialize the list beforehand
}
List( size_type count, const T& value ) {
// TODO - Don't forget initialize the list beforehand
}
explicit List( size_type count ) {
// TODO - Don't forget initialize the list beforehand
}
List( const List& other ) {
// TODO - Don't forget initialize the list beforehand
}
List( List&& other ) {
// TODO - Don't forget initialize the list beforehand
}
~List() {
// TODO
}
List& operator=( const List& other ) {
// TODO
}
List& operator=( List&& other ) noexcept {
// TODO
}
reference front() {
// TODO
}
const_reference front() const {
// TODO
}
reference back() {
// TODO
}
const_reference back() const {
// TODO
}
iterator begin() noexcept {
// TODO
}
const_iterator begin() const noexcept {
// TODO
}
const_iterator cbegin() const noexcept {
// TODO
}
iterator end() noexcept {
// TODO
}
const_iterator end() const noexcept {
// TODO
}
const_iterator cend() const noexcept {
// TODO
}
bool empty() const noexcept {
// TODO
}
size_type size() const noexcept {
// TODO
}
void clear() noexcept {
// TODO
}
iterator insert( const_iterator pos, const T& value ) {
// TODO
}
iterator insert( const_iterator pos, T&& value ) {
// TODO
}
iterator erase( const_iterator pos ) {
// TODO
}
void push_back( const T& value ) {
// TODO
}
void push_back( T&& value ) {
// TODO
}
void pop_back() {
// TODO
}
void push_front( const T& value ) {
// TODO
}
void push_front( T&& value ) {
// TODO
}
void pop_front() {
// TODO
}
/*
You do not need to modify these methods!
These method provide the non-const complement
for the const_iterator methods provided above.
*/
iterator insert( iterator pos, const T & value) {
return insert((const_iterator &) (pos), value);
}
iterator insert( iterator pos, T && value ) {
return insert((const_iterator &) (pos), std::move(value));
}
iterator erase( iterator pos ) {
return erase((const_iterator&)(pos));
}
};
/*
You do not need to modify these methods!
These method provide a overload to compare const and
non-const iterators safely.
*/
namespace {
template
using enable_for_list_iters = typename std::enable_if<
std::is_same<
typename List::value_type>::iterator,
Iter
>{} && std::is_same<
typename List::value_type>::const_iterator,
ConstIter
>{}, T>::type;
}
template
enable_for_list_iters operator==(const Iterator & lhs, const ConstIter & rhs) {
return (const ConstIter &)(lhs) == rhs;
}
template
enable_for_list_iters operator==(const ConstIter & lhs, const Iterator & rhs) {
return (const ConstIter &)(rhs) == lhs;
}
template
enable_for_list_iters operator!=(const Iterator & lhs, const ConstIter & rhs) {
return (const ConstIter &)(lhs) != rhs;
}
template
enable_for_list_iters operator!=(const ConstIter & lhs, const Iterator & rhs) {
return (const ConstIter &)(rhs) != lhs;
}
queue.h:
#ifndef QUEUE_H
#define QUEUE_H
#include "List.h"
template >
class Queue {
template
friend bool operator==(const Queue&, const Queue&);
public:
// Aliases for accessing data types outside of the class
using container_type = Container;
using value_type = typename Container::value_type;
using size_type = typename Container::size_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
private:
Container c;
public:
// The constructors, destructor, and assignment operators are done for you
Queue() = default;
Queue(const Queue& other) = default;
Queue(Queue&& other) = default;
~Queue() = default;
Queue& operator=(const Queue& other) = default;
Queue& operator=(Queue&& other) = default;
reference front() { /* TODO */ }
const_reference front() const { /* TODO */ }
reference back() { /* TODO */ }
const_reference back() const { /* TODO */ }
bool empty() const { /* TODO */ }
size_type size() const { /* TODO */ }
void push(const value_type& value) { /* TODO */ }
void push(value_type&& value) { /* TODO */ }
void pop() { /* TODO */ }
};
template
inline bool operator==(const Queue& lhs, const Queue& rhs) { /* TODO */ }
#endif

More Related Content

Similar to Please complete ALL of the �TO DO�s in this code. I am really strugg.pdf

C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxBrianGHiNewmanv
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxDIPESH30
 
for initializer_list include ltinitializer_listgt .pdf
 for initializer_list include ltinitializer_listgt .pdf for initializer_list include ltinitializer_listgt .pdf
for initializer_list include ltinitializer_listgt .pdfajay1317
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdfaggarwalopticalsco
 
In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdffantoosh1
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfsales98
 
you will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfyou will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfclearvisioneyecareno
 
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdfBANSALANKIT1077
 
template-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdftemplate-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdfashokadyes
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0Yaser Zhian
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfflashfashioncasualwe
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfEricvtJFraserr
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfaathmiboutique
 
C++ extension methods
C++ extension methodsC++ extension methods
C++ extension methodsphil_nash
 
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
Can somebody solve the TODO parts of the following problem- Thanks   D.pdfCan somebody solve the TODO parts of the following problem- Thanks   D.pdf
Can somebody solve the TODO parts of the following problem- Thanks D.pdfvinaythemodel
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docxhoney725342
 
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляАлексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляSergey Platonov
 

Similar to Please complete ALL of the �TO DO�s in this code. I am really strugg.pdf (20)

C++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docxC++ Please write the whole code that is needed for this assignment- wr.docx
C++ Please write the whole code that is needed for this assignment- wr.docx
 
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docxlab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
 
for initializer_list include ltinitializer_listgt .pdf
 for initializer_list include ltinitializer_listgt .pdf for initializer_list include ltinitializer_listgt .pdf
for initializer_list include ltinitializer_listgt .pdf
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdf
 
C Exam Help
C Exam Help C Exam Help
C Exam Help
 
In C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdfIn C++Add the function min as an abstract function to the classar.pdf
In C++Add the function min as an abstract function to the classar.pdf
 
Consider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdfConsider a double-linked linked list implementation with the followin.pdf
Consider a double-linked linked list implementation with the followin.pdf
 
you will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdfyou will implement some sorting algorithms for arrays and linked lis.pdf
you will implement some sorting algorithms for arrays and linked lis.pdf
 
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
#include -algorithm- #include -cstdlib- #include -iostream- #include -.pdf
 
template-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdftemplate-typename T- class Array { public- ---------------------------.pdf
template-typename T- class Array { public- ---------------------------.pdf
 
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
 
In C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdfIn C++Write a recursive function to determine whether or not a Lin.pdf
In C++Write a recursive function to determine whether or not a Lin.pdf
 
This assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdfThis assignment and the next (#5) involve design and development of a.pdf
This assignment and the next (#5) involve design and development of a.pdf
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
 
C++ extension methods
C++ extension methodsC++ extension methods
C++ extension methods
 
Antlr V3
Antlr V3Antlr V3
Antlr V3
 
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
Can somebody solve the TODO parts of the following problem- Thanks   D.pdfCan somebody solve the TODO parts of the following problem- Thanks   D.pdf
Can somebody solve the TODO parts of the following problem- Thanks D.pdf
 
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
03.DS_Store__MACOSX03._.DS_Store03A2.DS_Store__.docx
 
C Homework Help
C Homework HelpC Homework Help
C Homework Help
 
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуляАлексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуля
 

More from support58

Please show me your output. Andrew Kelly has been employed by the We.pdf
Please show me your output. Andrew Kelly has been employed by the We.pdfPlease show me your output. Andrew Kelly has been employed by the We.pdf
Please show me your output. Andrew Kelly has been employed by the We.pdfsupport58
 
Please show me how to do every part of this. Also could you show me .pdf
Please show me how to do every part of this. Also could you show me .pdfPlease show me how to do every part of this. Also could you show me .pdf
Please show me how to do every part of this. Also could you show me .pdfsupport58
 
Please help with the below 3 questions, the python script is at the.pdf
Please help with the below 3  questions, the python script is at the.pdfPlease help with the below 3  questions, the python script is at the.pdf
Please help with the below 3 questions, the python script is at the.pdfsupport58
 
please help! Carmen Company has the following projected costs for .pdf
please help! Carmen Company has the following projected costs for .pdfplease help! Carmen Company has the following projected costs for .pdf
please help! Carmen Company has the following projected costs for .pdfsupport58
 
Please help will upvote. I have a heuristic function that outputs th.pdf
Please help will upvote. I have a heuristic function that outputs th.pdfPlease help will upvote. I have a heuristic function that outputs th.pdf
Please help will upvote. I have a heuristic function that outputs th.pdfsupport58
 
Please create a simple flowchart of this programtell me the necess.pdf
Please create a simple flowchart of this programtell me the necess.pdfPlease create a simple flowchart of this programtell me the necess.pdf
Please create a simple flowchart of this programtell me the necess.pdfsupport58
 
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdf
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdfPlease answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdf
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdfsupport58
 
Plan production for a four-month period (February through May). .pdf
Plan production for a four-month period (February through May). .pdfPlan production for a four-month period (February through May). .pdf
Plan production for a four-month period (February through May). .pdfsupport58
 
Part 1 During the most recent economic crisis in the state of Arizo.pdf
Part 1 During the most recent economic crisis in the state of Arizo.pdfPart 1 During the most recent economic crisis in the state of Arizo.pdf
Part 1 During the most recent economic crisis in the state of Arizo.pdfsupport58
 

More from support58 (10)

Please show me your output. Andrew Kelly has been employed by the We.pdf
Please show me your output. Andrew Kelly has been employed by the We.pdfPlease show me your output. Andrew Kelly has been employed by the We.pdf
Please show me your output. Andrew Kelly has been employed by the We.pdf
 
Please show me how to do every part of this. Also could you show me .pdf
Please show me how to do every part of this. Also could you show me .pdfPlease show me how to do every part of this. Also could you show me .pdf
Please show me how to do every part of this. Also could you show me .pdf
 
Please help with the below 3 questions, the python script is at the.pdf
Please help with the below 3  questions, the python script is at the.pdfPlease help with the below 3  questions, the python script is at the.pdf
Please help with the below 3 questions, the python script is at the.pdf
 
please help! Carmen Company has the following projected costs for .pdf
please help! Carmen Company has the following projected costs for .pdfplease help! Carmen Company has the following projected costs for .pdf
please help! Carmen Company has the following projected costs for .pdf
 
Please help will upvote. I have a heuristic function that outputs th.pdf
Please help will upvote. I have a heuristic function that outputs th.pdfPlease help will upvote. I have a heuristic function that outputs th.pdf
Please help will upvote. I have a heuristic function that outputs th.pdf
 
Please create a simple flowchart of this programtell me the necess.pdf
Please create a simple flowchart of this programtell me the necess.pdfPlease create a simple flowchart of this programtell me the necess.pdf
Please create a simple flowchart of this programtell me the necess.pdf
 
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdf
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdfPlease answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdf
Please answer ASAP!!!Research Topic Ransomware attack on k-12 sch.pdf
 
Plan production for a four-month period (February through May). .pdf
Plan production for a four-month period (February through May). .pdfPlan production for a four-month period (February through May). .pdf
Plan production for a four-month period (February through May). .pdf
 
Part I.pdf
Part I.pdfPart I.pdf
Part I.pdf
 
Part 1 During the most recent economic crisis in the state of Arizo.pdf
Part 1 During the most recent economic crisis in the state of Arizo.pdfPart 1 During the most recent economic crisis in the state of Arizo.pdf
Part 1 During the most recent economic crisis in the state of Arizo.pdf
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

Please complete ALL of the �TO DO�s in this code. I am really strugg.pdf

  • 1. Please complete ALL of the TO DOs in this code. I am really struggling with this assignment. The last time I posted this question, they did not complete them all. Please do it! There are two files, list.h and queue.h. I tried to complete this on my own and none of it worked, so I am posting the template again instead of my nonworking code. Please do not use chatgpt, I think the last person used it. list.h: #pragma once #include // size_t #include // std::bidirectional_iterator_tag #include // std::is_same, std::enable_if template class List { private: struct Node { Node *next, *prev; T data; explicit Node(Node* prev = nullptr, Node* next = nullptr) : next{next}, prev{prev} {} explicit Node(const T& data, Node* prev = nullptr, Node* next = nullptr) : next{next}, prev{prev}, data{data} {} explicit Node(T&& data, Node* prev = nullptr, Node* next = nullptr) : next{next}, prev{prev}, data{std::move(data)} {} }; template class basic_iterator { public: using iterator_category = std::bidirectional_iterator_tag; using value_type = T; using difference_type = ptrdiff_t; using pointer = pointer_type; using reference = reference_type; private: friend class List; using Node = typename List::Node; Node* node;
  • 2. explicit basic_iterator(Node* ptr) noexcept : node{ptr} {} explicit basic_iterator(const Node* ptr) noexcept : node{const_cast(ptr)} {} public: basic_iterator() { /* TODO */ }; basic_iterator(const basic_iterator&) = default; basic_iterator(basic_iterator&&) = default; ~basic_iterator() = default; basic_iterator& operator=(const basic_iterator&) = default; basic_iterator& operator=(basic_iterator&&) = default; reference operator*() const { // TODO } pointer operator->() const { // TODO } // Prefix Increment: ++a basic_iterator& operator++() { // TODO } // Postfix Increment: a++ basic_iterator operator++(int) { // TODO } // Prefix Decrement: --a basic_iterator& operator--() { // TODO } // Postfix Decrement: a-- basic_iterator operator--(int) { // TODO } bool operator==(const basic_iterator& other) const noexcept { // TODO } bool operator!=(const basic_iterator& other) const noexcept { // TODO
  • 3. } }; public: using value_type = T; using size_type = size_t; using difference_type = ptrdiff_t; using reference = value_type&; using const_reference = const value_type&; using pointer = value_type*; using const_pointer = const value_type*; using iterator = basic_iterator; using const_iterator = basic_iterator; private: Node head, tail; size_type _size; public: List() { // TODO - Don't forget to initialize the list beforehand } List( size_type count, const T& value ) { // TODO - Don't forget initialize the list beforehand } explicit List( size_type count ) { // TODO - Don't forget initialize the list beforehand } List( const List& other ) { // TODO - Don't forget initialize the list beforehand } List( List&& other ) { // TODO - Don't forget initialize the list beforehand } ~List() { // TODO } List& operator=( const List& other ) { // TODO
  • 4. } List& operator=( List&& other ) noexcept { // TODO } reference front() { // TODO } const_reference front() const { // TODO } reference back() { // TODO } const_reference back() const { // TODO } iterator begin() noexcept { // TODO } const_iterator begin() const noexcept { // TODO } const_iterator cbegin() const noexcept { // TODO } iterator end() noexcept { // TODO } const_iterator end() const noexcept { // TODO } const_iterator cend() const noexcept { // TODO }
  • 5. bool empty() const noexcept { // TODO } size_type size() const noexcept { // TODO } void clear() noexcept { // TODO } iterator insert( const_iterator pos, const T& value ) { // TODO } iterator insert( const_iterator pos, T&& value ) { // TODO } iterator erase( const_iterator pos ) { // TODO } void push_back( const T& value ) { // TODO } void push_back( T&& value ) { // TODO } void pop_back() { // TODO } void push_front( const T& value ) { // TODO } void push_front( T&& value ) { // TODO } void pop_front() { // TODO
  • 6. } /* You do not need to modify these methods! These method provide the non-const complement for the const_iterator methods provided above. */ iterator insert( iterator pos, const T & value) { return insert((const_iterator &) (pos), value); } iterator insert( iterator pos, T && value ) { return insert((const_iterator &) (pos), std::move(value)); } iterator erase( iterator pos ) { return erase((const_iterator&)(pos)); } }; /* You do not need to modify these methods! These method provide a overload to compare const and non-const iterators safely. */ namespace { template using enable_for_list_iters = typename std::enable_if< std::is_same< typename List::value_type>::iterator, Iter >{} && std::is_same< typename List::value_type>::const_iterator, ConstIter >{}, T>::type; } template
  • 7. enable_for_list_iters operator==(const Iterator & lhs, const ConstIter & rhs) { return (const ConstIter &)(lhs) == rhs; } template enable_for_list_iters operator==(const ConstIter & lhs, const Iterator & rhs) { return (const ConstIter &)(rhs) == lhs; } template enable_for_list_iters operator!=(const Iterator & lhs, const ConstIter & rhs) { return (const ConstIter &)(lhs) != rhs; } template enable_for_list_iters operator!=(const ConstIter & lhs, const Iterator & rhs) { return (const ConstIter &)(rhs) != lhs; } queue.h: #ifndef QUEUE_H #define QUEUE_H #include "List.h" template > class Queue { template friend bool operator==(const Queue&, const Queue&); public: // Aliases for accessing data types outside of the class using container_type = Container; using value_type = typename Container::value_type; using size_type = typename Container::size_type; using reference = typename Container::reference; using const_reference = typename Container::const_reference; private: Container c; public: // The constructors, destructor, and assignment operators are done for you
  • 8. Queue() = default; Queue(const Queue& other) = default; Queue(Queue&& other) = default; ~Queue() = default; Queue& operator=(const Queue& other) = default; Queue& operator=(Queue&& other) = default; reference front() { /* TODO */ } const_reference front() const { /* TODO */ } reference back() { /* TODO */ } const_reference back() const { /* TODO */ } bool empty() const { /* TODO */ } size_type size() const { /* TODO */ } void push(const value_type& value) { /* TODO */ } void push(value_type&& value) { /* TODO */ } void pop() { /* TODO */ } }; template inline bool operator==(const Queue& lhs, const Queue& rhs) { /* TODO */ } #endif