{"id":107229,"date":"2022-11-23T04:41:29","date_gmt":"2022-11-23T04:41:29","guid":{"rendered":"https:\/\/assignmenttutors.net\/blog\/to-add-two-functions-the-questions-are-asking-you-develop-dividemid\/"},"modified":"2022-11-23T04:41:29","modified_gmt":"2022-11-23T04:41:29","slug":"to-add-two-functions-the-questions-are-asking-you-develop-dividemid","status":"publish","type":"post","link":"https:\/\/assignmenttutors.net\/blog\/to-add-two-functions-the-questions-are-asking-you-develop-dividemid\/","title":{"rendered":"To add two functions the questions are asking you develop: dividemid"},"content":{"rendered":"<div>\n<p>To add two functions the questions are asking you develop: divideMid and divideAt.<br \/>\u00a0<\/p>\n<p>4.(Dividing a linked list into two sublists of almost equal sizes)<br \/>a. Add the operation divideMid to the class linkedListType as follows:<br \/>void divideMid(linkedListType &amp;sublist);<br \/>\/\/This operation divides the given list into two sublist<br \/>\/\/of (almost) equal sizes.<br \/>\/\/Postcondition: first points to the first node and last<br \/>\/\/ points to the last node of the first sublist.<br \/>\/\/ sublist.first points to the first node and<br \/>\/\/sublist.last points to the last node of the second<br \/>\/\/sublist.<br \/>Consider the following statements:<br \/>unorderedLinkedList myList;<br \/>unorderedLinkedList subList;<br \/>Suppose myList points to the list with elements 34 65 27 89 12 (in this order). The<br \/>statement:<br \/>myList.divideMid(subList);<br \/>divides myList into two sublists: myList points to the list with the elements 34 65 27,<br \/>and subList points to the sublist with the elements 89 12.<br \/>b. Write the definition of the function template to implement the operation divideMid. Also<br \/>write a program to test your function.<br \/>\u00a0<\/p>\n<p>5.(splitting a linked list, at a given node, into two sublists)<br \/>a. Add the following operation to the class LinkedListType:<br \/>void divideAt (LinkedListClass&amp; secondList, const Type&amp; item);<br \/>\/\/Divide the list at the node with the info item into two sublists.<br \/>\/\/Postcondition: first and last point to the first and last nodes of the first sublist. <br \/>\/\/ secondList.first and secondList.last point to the first <br \/>\/\/ and last nodes of the second sublist.<br \/>\u00a0<\/p>\n<p>Consider the following statements:<br \/>\u00a0<\/p>\n<p>UnorderedLinkedList myList;<br \/>UnorderedLinkedList otherList;<br \/>\u00a0<\/p>\n<p>Suppose myList points to the list with the elements 34, 65, 18, 39, 27, 89, and 12 (in this order). The statement<br \/>\u00a0<\/p>\n<p>myList.DivideAt(otherList, 18);<br \/>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.<br \/>b. Write the defintion of the funcction template to implement the operation divideAt. Also write a program to test your function.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>To add two functions the questions are asking you develop: divideMid and divideAt.\u00a0 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 &amp;sublist);\/\/This operation divides the given list into two sublist\/\/of (almost) equal sizes.\/\/Postcondition: first points to the first node and last\/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-107229","post","type-post","status-publish","format-standard","hentry","category-education"],"_links":{"self":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/107229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/comments?post=107229"}],"version-history":[{"count":0,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/posts\/107229\/revisions"}],"wp:attachment":[{"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/media?parent=107229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/categories?post=107229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/assignmenttutors.net\/blog\/wp-json\/wp\/v2\/tags?post=107229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}