Question: A Sorted List ADT is to be extended by the addition of function SplitLists, which has the following specifications: SplitLists(SortedType list, ItemType item, SortedType& list1,
A Sorted List ADT is to be extended by the addition of function SplitLists, which has the following specifications:
SplitLists(SortedType list, ItemType item, SortedType& list1, SortedType& list2)
1. Implement SplitLists as a member function of the array-based Sorted List ADT. 2. Implement SplitLists as a member function of the linked Sorted List ADT. 3. Compare the algorithms used in
(a) and (b). 4. Implement SplitLists as a client function of the array-based Sorted List ADT. 5. Implement SplitLists as a client function of the linked Sorted List ADT.
Function: Preconditions: Postconditions: Divides list into two lists according to the key of item. list has been initialized and is not empty. listi contains all the items of list whose keys are less than or equal to item's key; list2 contains all the items of list whose keys are greater than item's key.
Step by Step Solution
3.51 Rating (148 Votes )
There are 3 Steps involved in it
Based on your question youve been asked to implement a function called SplitLists for a Sorted List Abstract Data Type ADT in different scenarios and then compare those implementations First some assu... View full answer
Get step-by-step solutions from verified subject matter experts
