Assignment
Extend the UnsortedType class with the following function and signature:
SplitLists(UnsortedType list, ItemType item, UnsortedType& list1,
UnsortedType& list2)
The SplitLists function will behave according to the following specifications:
Definition: divides list into two lists according to the value of item.
Preconditions: list has been initialized and is not empty. list1 contains all the items of list whose values are less than or equal to the value of item.
Postconditions: list2 contains all of the items of list whose values are greater than the value of item.
Complete the following implementations of the SplitLists function:
1) Implement SplitLists as an array-based member function of UnsortedType.
2) Implement SplitLists as a linked member function of UnsortedType.
Test each of the implementations in a driver using the following set of integers:
{ 5, -12, 34, 34, 5, 45, 8, -6, 15, 40, 20, 2, 1, 12 }
Use the following version of the ItemType class provided by the author:
class ItemType
{
public:
ItemType();
RelationType ComparedTo(ItemType) const;
void Print(std::ostream&) const;
void Initialize(int number);
private:
int value;
};
Format your assignment according to the following formatting requirements:
1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.
2. The response also includes a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.
3. Also include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.