Question: in c++ pleaseeeee asap 5. Write the code for a function int getIndex( int arr|l, int size, int value) which returns the index of value

5. Write the code for a function int getIndex( int arr|l, int size, int value) which returns the index of value inside the array, if value not found it should return -1. ( 10 points) getIndex (a,10,5)3 getIndex (a,10,50)1 6. Write a function bool isSorted(int all, int size) to check if a given array is sorted or not. For example: a={1,2,13,24,35} should return true, b={1,2,5,4,3} returns false. 7. write a function that merges two sorted arrays, (15 points) Merge (int al], int b[], int c[], int size), assume a and b both have the same size, and c always has the double size of them. for example: (15 points) a[3]={1,3,5}; b[3]={2,4,6}; Then retult should be c[6]={1,2,3,4,5,6}; Examples: if the array contains the following elements, the function should return false. Because value 1 is repeated. Even, if only one character appeared twice the function should return false. if the array contains the following elements, the function should return true. Because none of the characters is repeated. 4. Define and call the function isPalindrome, which check if the array consists of two parts where the second part is the reverse the first part. For example (1,2,3,3,2,1). Assume that the size of array is always even. ( 15 points) bool isPalindrome(int arr\|, int size) For example: Array (1,2,3,3,2,1) should return true Array (1,2,3,1,2,3) should return false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
