Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7. The divide and conquer algorithm, binary search, finds the median of a sorted array of length n is O(log n) time. Suppose a set
7. The divide and conquer algorithm, binary search, finds the median of a sorted array of length n is O(log n) time. Suppose a set of items is given to you in two sorted arrays, say X of length n and Y of length m. Write a divide and conquer algorithm which finds the median item of that set, namely the union of the items in X and the items in Y For example, if you are given the arrays: X = (1,2,5,6,9) and Y = (3,7, 10,11), the median item is 6. You may assume that there are no duplicate items, if that helps. If the number of items is even, the median item could be either of the two middle items. I have not given this algorithm in class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started