Question: hello I am struggling with this coding problem could you please explain it to me first in plain text what is happing and then coding
Extend the UnsortedType class with the following function and signature: SplitLists (UnsortedType list, ItemType item, UnsortedType& listi, 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 and list2 are empty. Postconditions: list1 contains all the items of list whose values are less than or equal to the value of item. 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(); Relation Type ComparedTo (ItemType) const; void Print(std::ostream&) const; void Initialize (int number); private: int value; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
