Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Object-Oriented Programming - Singly Linked List with these requirements SLList.hpp // It's a template class class SLList { public: // Default Constructor // Constructor

C++ Object-Oriented Programming - Singly Linked List with these requirements

SLList.hpp

// It's a template class

class SLList {

public:

// Default Constructor

// Constructor that takes first item for list

// It shall not be possible to create copies or assign directly to the linked list

// Destructor

// begin()

// end()

// A function called empty that lets you know if the list is empty or not

// A function called size that tells you how big the list is

// A function called front that returns the key value of the front node (return by value only)

// A function called push_back that adds a key to the end of the list

// A function called erase that takes as a parameter an iterator that indicates the Node to be erased.

// It returns an iterator that indicates the position after the node that was erased

// See the list class function of the same name at cplusplus.com

// A function called clear that erases the list, but leaves the list object in a viable state

private:

// Declare your Node class privately here

// A pointer to the first node in the list

};

// Probably a good spot for the iterator class declaration

// It is contained within a template class

class SLList::iterator {

public:

// Constructor that takes a Node pointer

// Overloaded postfix and prefix increment operators

// No decrements, this will be a forward-only iterator

// Overloaded de-reference operator, returns by value only

// Overloaded equality operator

// Overloaded inequality operator

private:

// Node pointer (resource being managed by the iterator)

};

// Implementations of classes go here

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_2

Step: 3

blur-text-image_3

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

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

More Books

Students also viewed these Databases questions

Question

What is the purpose of trainControl function in R?

Answered: 1 week ago