c++
1. Write a function that computes the alternating sum of all elements in an array. For example, if alternating_sum is called with an array containing 149 16 9 74 9 11 then it computes 1-4 + 9 - 16 + 9-7 +4-9+ 11 = -2 2. Write a function reverse that reverses the sequence of elements in an array. For example, if reverse is called with an array containing 149 16 9 749 11 then the array is changed to 11 9 4 7 9 16 941 3. Write a function bool equals(int a[], int a_size, int b[], int b_size) that checks whether two arrays have the same elements in the same order. 4. Write a function bool same_set(int a[], int a_size, int b[], int b_size) that checks whether two arrays have the same elements in some order, ignoring duplicates. For example, the two arrays 1 4 9 16 9 7 4 9 11 and 11 11 7 9 16 41 would be considered identical. You will probably need one or more helper functions. 5. Write a function bool same_elements (int a[], int b[], int size) that checks whether two arrays have the same elements in some order, with the same multiplicities. For example, 149 16 9 74 9 11 and 1114 9 16 9 749 would be considered identical, but 149 16 9 74 911 and 11 11 79 16 4 1 49 would not. You will probably need one or more helper functions. 6. Write a function that removes duplicates from an array. For example, if remove_duplicates is called with an array containing 149 16 9 7 4 9 11 then the array is changed to 149 16 7 11 Your function should have a reference parameter for the array size that is updated when removing the duplicates. 7. Write a function that computes the average of the neighbors of a two-dimensional array element in the eight directions shown in Figure 12. double neighbor_average (int values [] [, int row, int column) However, if the element is located at the boundary of the array, only include the neighbors that are in the array. For example, if row and column are both O, there are only three neighbors. 8. Write a function vector int> append(vector
a, vector int> b) that appends one vector after another. For example, if a is 149 16 and bis 974911 then append returns the vector 149 16 9 74 9 11 9. Write a function vector int> merge (vector a, vector b) that merges two vectors, alternating elements from both vectors. If one vector is shorter than the other, then alternate as long as you can and then append the remaining elements from the longer vector. For example, if a is 149 16 and bis 9 74 9 11 then merge returns the vector 1947 94 16 9 11 10. Write a function vector merge_sorted (vector a, vector b) that merges two sorted vectors, producing a new sorted vector. Keep an index into each vector, indicating how much of it has been processed already. Each time, append the smallest unprocessed element from either vector, then advance the index. For example, if a is 149 16 and bis 479 911 then merge_sorted returns the vector 144 79 9 9 11 16