1.Write an additional method called push_back(int) that will add an integer to the end of the list. You can modify the provided code.
 2.Modify the Node class and LinkedList class so that you can access your parent node (double linked-list).
 
#include
#include
using namespace std;
typedef int Type;
enum Boolean
{
False = 0, True
};
class Item
{
friend class SLList;
public:
Type getVal()
{
return val;
}
private:
Item(Type value, Item *item = 0)
{
val = value;
next = item;
}
Type val;
Item *next;
};
class SLList
{
public:
class Const_Iterator
{
friend class SLList;
public:
Item *current;
Const_Iterator() :
current(NULL)
{
}
const Item & operator*() const
{
return *this->current;
}
Const_Iterator operator++()
{
current = current->next;
return *this;
}
Const_Iterator operator++(int)
{
Const_Iterator old = *this;
++(*this);
return old;
}
bool operator==(const Const_Iterator & rhs)
{
return current == rhs.current;
}
bool operator!=(const Const_Iterator & rhs)
{
return !(*this == rhs);
}
Item retrieve() const
{
return current->val;
}
Const_Iterator(Item *p) :
current(p)
{
}
};
class Iterator
{
friend class SLList;
public:
Item *current;
Iterator() :
current(NULL)
{
}
const Item & operator*() const
{
return *this->current;
}
Iterator operator++()
{