Let be a fixed constant. You are given a set of positive integers less than , and you are tasked to sort it.
Which of the following is the asymptotic running time of the fastest possible algorithm?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
[Partial Solution]
Use Counting Sort .
First, read the stream of the values and generate a histogram. Then use the histogram to determine the value in each position.