subject

Use the file names listed below since your file will have the following components:
ch16_ex5_mainprogram. cpp - given file
//22 34 56 4 19 2 89 90 0 14 32 88 125 56 11 43 55 -999
#include
#include "unorderedlinkedlist. h"
using namespace std;
int main()
{
unorderedlinkedlist list, sublist;
int num;
cout < < "enter numbers ending with -999" < < endl;
cin > > num;
while (num ! = -999)
{
list. insertlast(num);
cin > > num;
}
cout < < endl;
cout < < "list: ";
list. print();
cout < < endl;
cout < < "length of the list: " < < list. length() < < endl;
list. dividemid(sublist);
cout < < "lists after splitting list" < < endl;
cout < < "list: ";
list. print();
cout < < endl;
cout < < "length of the list: " < < list. length() < < endl;
cout < < "sublist: ";
sublist. print();
cout < < endl;
cout < < "length of sublist: " < < sublist. length() < < endl;
system("pause");
return 0;
}
linkedlist. h
unorderedlinkedlist. h
dividing a linked list into two sublists of almost equal sizes:
add the operation dividemid to the class linkedlisttype as follows:
void dividemid(linkedlisttype & sublist);
//this operation divides the given list into two sublists
//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.
write the definition of the function template to implement the operation dividemid. also, write a program to test your function.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, hannahrasco4051
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 25.06.2019 03:30, adrianVocke5685
Kou converged his word document to a powerpoint document. when he received the powerpoint, he was missing material. which most likely explains why the material was missing? a it did not have a proper heading b he incorrectly copied and pasted it c he did not save his document properly d there was not enough space in powerpoint
Answers: 1
image
Computers and Technology, 25.06.2019 07:30, volocibel
Which behavior demonstrates teamwork
Answers: 1
image
Computers and Technology, 25.06.2019 09:00, pacetys
Which element of a presentation program’s interface displays the slide you are currently creating or editing? a. slide pane b. tool bar c. menu bar d. scroll bar
Answers: 1
You know the right answer?
Use the file names listed below since your file will have the following components:
ch16_ex5_...

Questions in other subjects:

Konu
Mathematics, 10.05.2021 23:40
Konu
Mathematics, 10.05.2021 23:40