Question: Question 4 : Lower Bounds and Linear time Sorting ( a ) Let A be an array of n real ( decimal ) numbers, uniformly
Question : Lower Bounds and Linear time Sorting
a Let be an array of real decimal numbers, uniformly distributed from to
A student would like to print out the smallest numbers in increasing order. Consider the three
approaches below:
OPTION
Select
Loop through A and store
all items that are less than
or equal to in a list
Sort list in increasing or
der, using QuickSort.
Print
OPTION
Setup Bucket sort using
equallysized buckets in the
range to Bucket covers
the range to inclusively.
Distribute the points into buck
ets.
Run insertion sort on the ele
ments of bucket
Print out the sorted elements
from bucket
OPTION
Loop through input and set
to be the maximum element
found
Use Counting sort with
maximumsized element
Print out the first 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 Draw the decision tree for the inplace partition algorithm on four elements.
c A car license consists of characters, where the characters alternate between alphabetic
characters A to Z and numerical characters to An example of a valid license is
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
