Hi i have this for a practical tomorrow (C++):
a) Write a function vector merge(vector a, vector b) that mergestwo vectors, alternating elements from both vectors. If one vectoris shorter than the other, then alternate as long as you can andthen append the remaining elements from the longer vector.
For example, if a is 1 4 9 16 and b is 9 7 4 9 11
Then merge returns the vector 1 9 4 7 9 4 16 9 11
b) Write a function vector merge_sorted(vector a, vector b) thatmerges two sorted vectors, producing a new sorted vector. Forexample, if a is 1 4 9 16 and b is 9 7 4 9 11 Then merge_sortedreturns the vector 1 4 4 7 9 9 9 11 16
c) Write a procedure void pie_chart(vector data) that displays apie chart of the values in data, assuming that all values in dataare positive.
d) Write the selection sort algorithm as a template function,which can sort both numeric and string data types.