Linked-List Iterator Solution

$30.00

Description

You may not use the standard template library for this or any other project this semester unless specifically mentioned in the instructions. Disclaimer: I \<name\> have not used any code other than my own (orthat in the textbook) forthis project. I also have not used any

function or data-structure from the Standard-Template Library. I understand that any violation of this disclaimer will resuft in a 0 for the project.

Purpose

• Understanding external iterators and linked lists.

Instructions

Create a List class with the following member functions:

o ListO lli.e. default constructor o -ListO

ovoid push_front(const int& value) II add new node to front of the list

ovoid push..,back(const int& value) II add new node to back of the list

ovoid remove(const int& value) II removes All nodes in list with this value o Iterator beginO II iterator to the beginning of the list

o Iterator endt) II iterator to the end of the list

oint sizeO II number of elements currently in list ovoid PrintListO II mainly for debugging

documentation of the above member functions can be found at:

o http://en.cppreference.com/w/cpp/contamer/list

Create an Extemallterator class called fterator with the following member functions:

o Iterator(Node *start) II The iterator initially points to “start”. oint operator=t) II dereference the iterator

o Iterator operator++O II advance the iterator

o bool operator!=(const Iterator& other) II returns true if and only If other iterator does not equal this iterator o bool is_itemO II returns true if Iterator points to a valid Node (if nullptr return false …)

Create a Node class o NodeO

o data

o next

o Observer trnp; II required for Unit Testing

Complete the implementation of all the functions using a Linked List as the underlying implementation.

Use the code in Maln.cpp to verify that your list functions properly, (You can add your Project Prologue comments to the beginning of

List.cpp)