Question: Using C++: Write a client function that merges two instances of the sorted list ADT using the following specifications. MergeLists(SortedType list1, SortedType list2, SortedType& result)
Using C++: Write a client function that merges two instances of the sorted list ADT using the following specifications.
MergeLists(SortedType list1, SortedType list2, SortedType& result)
Function: Merge two sorted lists into a third sorted list
Preconditions: list1 and list2 have been initalized and are sorted by key using function ComparedTo. list1 and list2 do not have any keys in common.
Postconditions: result is a sorted list that contains all of the items from list1 and list2.
A) Write the prototype for MergeLists.
B) Write the function definition, using an array-based implementation.
C) Write the function definition, using a linked implementation.
D) Describe the algorithm in terms of Big-O
E) Rewrite the prototype making MergeLists an array-based member function of the Sorted List ADT
F) Rewrite the prototype making MergeLists a linked member of the function of the Sorted List ADT.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
