Question: Need help with 1 and 2: 2. Recursive Algorithm and Analysis Suppose company X has hired you as a software engineer. Company X is desperate

Need help with 1 and 2:

Need help with 1 and 2: 2. Recursive Algorithm and Analysis Suppose

2. Recursive Algorithm and Analysis Suppose company X has hired you as a software engineer. Company X is desperate to improve the run time of their software. Rather than allow you to use the standard binary search algorithm, company X demands you create a new version. Since recursively dividing the array into two parts is so efficient for searching, the bigwigs at company X conclude dividing the array into three parts will be even more efficient. This new "3-ary" search divides the given sorted array into 3 equal sized sorted subarrays. It finds which subarray will contain the given value and then recursively searches that subarray. If the given value is in the array you should return true. Otherwise you should return false. (1) (10 points) Create a recurrence to represent the worst case run time of our new "3-ary" search . (Hint: For simplicity you can assume the number of elements in the given sorted array, n, is a power of 3 . and the worst case run time occurs when the given value is not in the array) (2) (15 point) Use master theorem to solve your above recurrence relation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!