Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I am looking for assistance with this programming challenge. Please do not use other answers seen on the internet as I am using this

Hello, I am looking for assistance with this programming challenge. Please do not use other answers seen on the internet as I am using this for learning purposes as I am confused on how to fully code this. Thanks

Implement the following specification of UnsortedType using a circular linked list as the implementation structure. Language: C++

template

struct NodeType;

/* Assumption: ItemType is a type for which the operators

"<" and "==" are definedeither an appropriate built-in type or a class that overloads these operators. */

template

class UnsortedType

{

public:

// Class constructor, destructor, and copy constructor

UnsortedType();

~UnsortedType();

UnsortedType(const UnsortedType&);

void operator=(UnsortedType);

bool IsFull() const;

// Determines whether list is full.

// Post: Function value = (list is full)

int GetLength() const;

// Determines the number of elements in list.

// Post: Function value = number of elements in list.

void RetrieveItem(ItemType& item, bool& found);

// Retrieves list element whose key matches item's key

// (if present).

// Pre: Key member of item is initialized.

// Post: If there is an element someItem whose key matches

// item's key, then found = true and item is a copy of

// someItem; otherwise found = false and item is

// unchanged.

// List is unchanged.

void InsertItem(ItemType item);

// Adds item to list.

// Pre: List is not full.

// item is not in list.

// Post: item is in list.

void DeleteItem(ItemType item);

// Deletes the element whose key matches item's key.

// Pre: Key member of item is initialized.

// One and only one element in list has a key matching

// item's key.

// Post: No element in list has a key matching item's key.

void ResetList();

// Initializes current position for an iteration through the

// list.

// Post: Current position is prior to list.

void GetNextItem(ItemType&);

// Gets the next element in list.

// Pre: Current position is defined.

// Element at current position is not last in list.

// Post: Current position is updated to next position.

// item is a copy of element at current position.

private:

NodeType* listData;

int length;

NodeType* currentPos;

};

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

Step: 3

blur-text-image

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago

Question

=+3. What is content curation and its role within social media?

Answered: 1 week ago