Question: As we have studied in the class, in Binary Search Problem ( BSP ) , input array A is divided into two subproblem at each
As we have studied in the class, in Binary Search Problem BSP input array A is divided into two
subproblem at each iteration. Here is the illustration of input length in recursive calls:
We know that the complexity of BSP is What happens if we divide the problem into or
subproblems at each iteration? Assume that we divide the given problem into subproblems. Then
the above image will be like as follows:
n
If the problem is divided into or or more subproblems, we will have much smaller sub problems
in each iteration. Is this going to improve the complexity of search? That is can we find the key
element that we are looking in the given array in a smaller number of comparisons? You will
implement BSP where the given array is divided into sub problems instead of
pts Implement BSP where the given input is divided into subproblems in each iteration.
pts Place appropriate counter, say c to determine number of lines your algorithm is
executing. Tabulate input size n and counters for both BSP algorithms for
Note that BSP with two subproblems already exists on the blackboard. So
you can download and run both algorithms on the same sorted array and determine their
number of lines executed.
pts Give a complete complexity analysis of your algorithm.
pts Is this new algorithm better than more efficient than the original? Why?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
