Question: _Consider the following extension to Binary Search a sorted list A for an item x: Let's call it UnevenBinSearch. Let ap be the partitioning

_Consider the following extension to Binary Search a sorted list A for

_Consider the following extension to Binary Search a sorted list A for an item x: Let's call it UnevenBinSearch. Let ap be the partitioning element of A so that A is divided into two lists, left sublist is close to length [n/3] and the right sublist is of length n-[n/3]-[2n/3] (i.e., a difference of 1 or 2 is allowed between the sizes of these sublists but no more). Based on ap, decide the sublist where x may exist. Repeat this process until the sublist is small enough that the answer can be directly obtained. 4.1. Write pseudo-code for the above UnevenBinSearch method, specifying all the parameters correctly. 4.2. Derive the recurrence relation for the running time of the UnevenBinSearch algorithm. 4.3. Solve the recurrence relation, find a close-bound for the running time of UnevenBinSearch and then express this close-bound using asymptotic notation. Justify your answer. 4.4. Derive an expression and its asymptotic bound for the space complexity of UnevenBinSearch.

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