(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...

Published on December 2017 | Categories: Graphic Art | Downloads: 135 | Comments: 0 | Views: 618
of 1
Download PDF   Embed   Report

(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.

Comments

Content

(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.

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close