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  

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

1 Expert Approved Answer
Step: 1 Unlock

The image youve provided contains three questions each requesting the creation of a recursive functi... View full answer

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 Programming Questions!