Question: Question 4 : Lower Bounds and Linear time Sorting ( a ) 1 0 points Let ( A [ ] ) be an

Question 4: Lower Bounds and Linear time Sorting
(a)10 points Let \( A[]\) be an array of \( n \) real (decimal) numbers, uniformly distributed from 1 to 100. A student would like to print out the smallest \(\mathrm{t}\sqrt{n}\) numbers in increasing order. Consider the three approaches below:
OPTION 1
1.\( k=\sqrt{n}\).
2.\( p=\operatorname{Select}(A,1, n, k)\).
3. Loop through \( A[]\) and store all items that are less than or equal to \( p \), in a list \( L \)
4. Sort list \( L \) in increasing order, using QuickSort.
5. Print \( L \)
OPTION 2
1. Set-up Bucket sort using 10 equally-sized buckets in the range 1 to 100. Bucket 1 covers the range 1 to 10 inclusively.
2. Distribute the points into buckets.
3. Run insertion sort on the elements of bucket 1
4. Print out the sorted elements from bucket 1.
OPTION 3
1. Loop through input \( A[\) and set \( m \) to be the maximum element found
2. Use Counting sort with maximum-sized element \( m \)
3. Print out the first \(\sqrt{n}\) elements from the resulting sorted array
Your Job:
For each option, determine if the procedure correctly solves the problem.
Determine the Expected runtime of each approach, and justify your answer.
Which option is expected to be asymptotically faster? Or are they expected to be asymptotically equivalent?
(b)4 points Draw the decision tree for the in-place partition algorithm on four elements.
(c)4 points A car license consists of 6 characters, where the characters alternate between alphabetic characters (A to Z) and numerical characters (1 to 9). An example of a valid license is \( B 1 C 3 X 4\). Explain how to sort a set of \( n \) licenses using Radix sort, and justify the runtime.
I need the answer in written format (on paper).
Question 4 : Lower Bounds and Linear time Sorting

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!