Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. (40 marks) Let X and Y be two arrays, each containing n distinct integers in ascending order. The problem is to compute the median

image text in transcribed

3. (40 marks) Let X and Y be two arrays, each containing n distinct integers in ascending order. The problem is to compute the median of all 2n elements in time (lg n) (a) (5 marks) Give a formal definition (pre- and post-conditions) of the problem described. (b) (10 marks) Give a divide-and-conquer algorithm for solving the problem. (c) (10 marks) Prove that your algorithm is correct (d) (5 marks) Express the run-time of your algorithm as a recurrence relation. Explain why your recurrence relation is correct (e) (10 marks) Prove a tight asymptotic bound on the run-time of your algorithm (proving upper and lower bounds separately if necessary). You may use the master theorem, or a version of the "guess and prove" method. Note: Algorithms that do not use divide-and-conquer will receive no credit. Divide-and- conquer algorithms with run-time in (Ign) will receive partial credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago