Cs445 — Homework #2
Lower bound on Sorting, Radix Sort, SkipList and
Random Variables
Due: 3/1/2005 during class meeting.
1. Suggest an algorithm that sort
n
integers, each with
k
decimal digits in time
O
(
nk
). The algorithm uses
k
passes of counting sort, but does it from the most
significant digit to the least significant digit. Discuss possible advantages and
disadvantages of this algorithms comparing to the “traditional” radix sort.
2. Assume that the running time of merge sort is
O
(
n
log
n
), and the running time
of sorting
n
numbers, each of
k
decimals digits, using Radix sort, is
O
(
nk
).
Prove that if no two numbers in the input are the same, then radix sort is
always not faster than merge sort. Does this implies that you would always use
merge sort over radix sort ?
3. This question deals with
approximation algorithm for sorting
.
Let
S
=
{
x
1
. . . x
n
}
be a sequence of
n
different numbers, all between 0 and 1. Assume
also that 0 and 1 are in the input.
Let
π
be the permutation of the input
numbers describing the input keys in an increasing sorted order. That is
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '06
 Williams
 Sort

Click to edit the document details