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

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

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)
a. Add the operation divideMid to the class linkedListType as follows:
void divideMid(linkedListType &sublist);
//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:
unorderedLinkedList myList;
unorderedLinkedList subList;
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)
a. Add the following operation to the class LinkedListType:
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:
UnorderedLinkedList myList;
UnorderedLinkedList otherList;
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.

"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top