Question: 1. Write a recursive function int binarySearch(int[] a, int start, int end, int x) that uses the binary search algorithm to check whether the
1. Write a recursive function int binarySearch(int[] a, int start, int end, int x) that uses the binary search algorithm to check whether the sorted array a contains the element x anywhere between indices start and end, inclusive. Function should return index of element 'x' if it exists in the array and return -1 otherwise. 2. Write a recursive function of MergeSort to sort an array in ascending order 3. Write a recursive function Sum that takes a two-dimensional array and returns sum of its all elements.
Step by Step Solution
3.45 Rating (155 Votes )
There are 3 Steps involved in it
The image youve provided contains three questions each requesting the creation of a recursive functi... View full answer
Get step-by-step solutions from verified subject matter experts
