Posted: October 28th, 2022

To add two functions the questions are asking you develop: divideMid and divideAt.

4.(Dividing a linked list into two sublists of almost equal sizes)
//This operation divides the given list into two sublist
//of (almost) equal sizes.
//Postcondition: first points to the first node and last
// points to the last node of the first sublist.
// sublist.first points to the first node and
//sublist.last points to the last node of the second
//sublist.
Consider the following statements:
Suppose myList points to the list with elements 34 65 27 89 12 (in this order). The
statement:
myList.divideMid(subList);
divides myList into two sublists: myList points to the list with the elements 34 65 27,
and subList points to the sublist with the elements 89 12.
b. Write the definition of the function template to implement the operation divideMid. Also
write a program to test your function.

5.(splitting a linked list, at a given node, into two sublists)
void divideAt (LinkedListClass& secondList, const Type& item);
//Divide the list at the node with the info item into two sublists.
//Postcondition: first and last point to the first and last nodes of the first sublist.
// secondList.first and secondList.last point to the first
// and last nodes of the second sublist.

Consider the following statements:

Suppose myList points to the list with the elements 34, 65, 18, 39, 27, 89, and 12 (in this order). The statement

myList.DivideAt(otherList, 18);
Divides myList into two sublists: myList points to the list with elements 34 and 65, and otherList points to the sublist with elements 18, 39, 27, 89, and 12.
b. Write the defintion of the funcction template to implement the operation divideAt. Also write a program to test your function.

### Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

## Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
\$0.00
error: Content is protected !!

Order your essay today and save 15% with the discount code DISCOUNTS2023