Question: Consider the following problem. Input: n 2 distinct numbers in some arbitrary order. Output: an n n matrix containing the input numbers, and having all
Consider the following problem.
Input: distinct numbers in some arbitrary order.
Output: an matrix containing the input numbers, and having all rows and all columns sorted in increasing order.
Example: so Say the numbers are the digits dots, Possible outputs include:
dots
It is clear that we can solve this problem in time by just sorting the input remember that : and then outputting the first elements as the first row, the next elements as the second row, and so on Your job in this problem is to prove a matching lower bound in the comparisonbased model of computation, ie a lower bound of for some constant that is independent of For simplicity, you can assume is a power of
Hint: You may use the facts that and that and comparison based sorting algorithm must make at least comparisons.
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
