To add two functions the questions are asking you develop: dividemid

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.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more