Implement a recursive search function in java - what is the


(a) Implement a recursive search function in Java

int terSearch(int arr[], int l, int r, int x)
that returns location of x in a given sorted array arr[l...r] is present, otherwise -1.
The terSearch search function, unlike the binary search, must consider two dividing points
int d1 = l + (r - l)/3
int d2 = d1 + (r - l)/3

(b) What is the running time complexity of your function? Justify.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Implement a recursive search function in java - what is the
Reference No:- TGS02366568

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)