Write An Additional Method Called Push Back

Post a question
Help

Contact Us
FAQ

Homework Answers
Login

Not a Member? Sign up!

Post a question
Help

Contact Us
FAQ

Homework Answers
Login

Not a Member? Sign up!

adelen2.0 (4)3.5 (16)ChatWrite an additional method called push_back

Main

Home
Computer Science homework help

Report Issue
 
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++()
{

Posted: 17 days ago

answer in c++
Purchase the answer to view it

answer.docx

Buy tutorial $30Save time and money!Our teachers already did such homework, use it as a reference!
Blog ArchiveCopyright © 2019 HomeworkMarket.com Read More

Applied Sciences
Architecture and Design
Biology
Business & Finance
Chemistry
Computer Science
Geography
Geology
Education
Engineering
English
Environmental science
Spanish
Government
History
Human Resource Management
Information Systems
Law
Literature
Mathematics
Nursing
Physics
Political Science
Psychology
Reading
Science
Social Science

 
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”

What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but splendidwritings.com proved they are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 14***| Rating: ⭐⭐⭐⭐⭐
"The company has some nice prices and good content. I ordered a term paper here and got a very good one. I'll keep ordering from this website."

"Order a Custom Paper on Similar Assignment! No Plagiarism! Enjoy 20% Discount"