Question: c++ Exercise 2: (10 points) Write a function resize0 that takes as arguments: a pointer pointing to the array of integers, its size, and new_size.

c++
c++ Exercise 2: (10 points) Write a function resize0 that takes as

Exercise 2: (10 points) Write a function resize0 that takes as arguments: a pointer pointing to the array of integers, its size, and new_size. New_sizecan be any number greater than 0 . This function shoukd change the size of the array. If the new size is greater than the previous one, then insert zeroes in new cells. Example: Case 1: (new_sine > sine) new_size =7, sine =5 Before calling resize function: Array \begin{tabular}{|l|l|l|l|l|} \hline 2 & 32 & 4 & 34 & 51 \\ \hline \end{tabular} After calling resio function: Array Case 2: (new_size \begin{tabular}{|l|l|l|} \hline 2 & 32 & 4 \\ \hline \end{tabular} Exercise 3: (10 points) Write a code that merges two arrays. Create two dynamic arrays of sives size I and size_2 respectively. Take input in these arrays from the user. Now create a third array of size (size_l+size_2) and insert all the elements of both arrays in this array. Remove the duplicate elements from this array and resize the array to a smaller size. Example: Array 1=> Array 2m>\begin{tabular}{|l|l|l|l|l|} \hline 3 & 4 & 5 & 6 & 7 \\ \hline \end{tabular} After merging Arrayl and Array2: Array 3=> After removing duplicate elements, this array shoukd be of size 6 : Array 3=> Page | 11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!