Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:50, prettybaby406
Explain why it is reasonable to assume that receiving 3 duplicate acks in tcp is an indication that the network is not currently congested.
Answers: 1
image
Computers and Technology, 22.06.2019 00:40, 1fuzzybirdow6e0s
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
image
Computers and Technology, 22.06.2019 10:20, vuqepete4528
Shown below is the start of a coding region within the fist exon of a gene. 5'--3' 3'--5' how many cas9 pam sequences are present?
Answers: 1
image
Computers and Technology, 22.06.2019 19:20, mahaleyrenee1195
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 2
Do you know the correct answer?
Use the file names listed below since your file will have the following components:
ch16_ex5_...

Questions in other subjects:

Konu
History, 07.10.2019 18:30