Write a client function that merges two instances of the


Write a client function that merges two instances of the Sorted List ADT using the following specification.

MergeLists(SortedType list1, SortedType list2,SortedType& result)

Function: Merge two sorted lists into a thirdsorted list.
Preconditions: list1 and list2 have been initialized 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.

Then I need to rewrite it making MergeLists an array-based member function of the Sorted List ADT. Also to rewrite that making MergeLists a linked member function of the SortedList ADT.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a client function that merges two instances of the
Reference No:- TGS01245694

Now Priced at $20 (50% Discount)

Recommended (92%)

Rated (4.4/5)