subject

For this proficiency test you will write a program that works with an array of integers. The file supplied. o contains binary code that can build, and display an array. For this test, you will need to write the following functions in array. cpp, add function prototypes for them to array. h and invoke the functions in main. cpp. - int sumOfArray(int list[], int size) Compute and return the sum of integers in list. - int remove(int list[], int
-void insert(node *& head, int position, int newInt)
insert newInt in a new node at index "position" where index starts with 0. In other words, the head node is position 0, head->next is position 1, etc. If the parameter position is less than or equal to zero, then place the new node at position 0. If position is greater than or equal to the length of the list, then place the new node at the end of the list. Notice that the head parameter is a reference to a pointer. So anything you do to head in insert() will modify the head pointer in main.
The code files will compile and run without modification, so you can see what build and display will do without adding any code. This may help you get started.
The function build() will create a linear linked list that is from 10 to 20 nodes in length.

The files are below.

//list. cpp
#include "list. h"
//put the implementation of your assigned functions here
——————————————————————————————
//list. h
#ifndef LIST_H
#define LIST_H
#include
#include
#include
struct node
{
int data;
node * next;
};
/* These functions are already written and can be called to test out your code */
void build(node * & head); //supplied. The resulting list will have from 10 to 20 nodes.
void display(node * head); //supplied
void destroy(node * &head); //supplied
/* YOUR TURN! */
//Write your function prototype here:
#endif
——————————————————————————
//main. cpp
#include "list. h"
using namespace std;
int main()
{
node * head = NULL;
build(head); // build() and display() are provided by supplied. o.
display(head); // Don't try to write the function definitions for them.
//PLEASE PUT YOUR CODE HERE to call the functions assigned.
display(head);
destroy(head); // destroy() is also provided by supplied. o.
return 0;
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:30, zaratayyibah
Which of the choices sean are not true when considering virus behavior
Answers: 1
image
Computers and Technology, 22.06.2019 15:00, miracle9704
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
image
Computers and Technology, 23.06.2019 01:30, shelley3135
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
image
Computers and Technology, 23.06.2019 03:30, mem81
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
You know the right answer?
For this proficiency test you will write a program that works with an array of integers. The file su...

Questions in other subjects: