Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 2 . The templated class UnsortedList based on linked nodes is given below. Write the prototype and definition of member function splitList which divides

Problem 2. The templated class UnsortedList based on linked nodes is given below. Write the prototype and definition of member function splitList which divides the current list into two lists according to a given key. The precondition and postcondition of a new member function splitList are below:
// Precondition: the current list has been initialized.
// Postcondition: listl contains all elements of the current list which are less than or equal to the given key. The second list 2 contains data which are greater than the given key.
// File UnsortedList.h: Header file for Unsorted List ADT.
// preprocessor directives
template class ItemType >
struct NodeType
Item Type info;
NodeType ItemType >* next;
};
template class ItemType >
class UnsortedList
}
public:
UnsortedList (){length =0; listData ?N=ULL;
UnsortedList ();
bool full() const;
int lengthIs () const;
void makeEmpty();
void insertItem(ItemType item);
void deleteItem(ItemType item);
void print((Additional Requirements:/* You are allowed to use only the public member functions makeEmpty() and insertItem(...) listed in the given UnsortedList.h file. "/// Do not change any of the given identifiers of given file UnsortedList.h and the Postcondition.// Do not add any additional member function to the class UnsortedList.a) Problem 2 a. Specify the file and write the prototype of member function splitList.b) Problem 2b. Specify the file and write the templated definition of new member function splitList.
image text in transcribed

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

1 Some key facts about U.S. international trade.

Answered: 1 week ago

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago