6.851: Advanced Data Structures
Spring 2010
Lecture 12 — March 16, 2010
Prof. Erik Demaine
Scribe: Haitao Mao
1
Overview
In the last lecture we covered the round elimination technique and lower bounds on the static
predecessor problem.
In this lecture we cover the signature sort algorithm for sorting large integers in linear time.
2
Introduction
Thorup [7] showed that if we can sort
n w
bit integers in
O
(
nS
(
n, w
)), then we have a priority
queue that can support the insertion, deletion, and find minimum operations in
O
(
S
(
n, w
)). To
get a constant time priority queue, we need linear time sorting, but whether we can get this is still
an open problem. Following is a list of results outlining the current progress on this problem.
•
Comparison model:
O
(
n
lg
n
)
•
Counting sort:
O
(
n
+ 2
w
)
•
Radix sort:
O
(
n
·
w
lg
n
)
•
van Emde Boas:
O
(
n
lg
w
), improved to
O
(
n
lg
w
lg
n
) (see [6]).
•
Signature sort: linear when
w
= Ω(lg
2+
ε
n
) (see [2]).
•
Han [4]:
O
(
n
lg lg
n
) deterministic, AC
0
RAM.
•
Han and Thorup:
O
(
n
√
lg lg
n
) randomized, improved to
O
(
n
q
lg
w
lg
n
) (see [5] and [6])).
Today, we will focus entirely on the details of the signature sort. This algorithm works whenever
w
= Ω(log
2+
ε
n
).
Radix sort, which we should already know, works for smaller values of
w
,
namely when
w
=
O
(log
n
).
For all other values of
w
and
n
, it is open whether we can sort in
linear time. We previously covered the van Emde Boas tree, which allows for
O
(
n
log log
n
) sorting
whenever
w
= log
O
(1)
n
. The best we have done in the general case is a randomized algorithm in
O
(
n
q
log
w
log
n
) time by Han, Thorup, Kirkpatrick, and Reisch.
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
3
Sorting for
w
= Ω(log
2+
ε
n
)
The signature sort was developed in 1998 by Andersson, Hagerup, Nilsson, and Raman [2]. It sorts
n w
bit integers in
O
(
n
) time when
w
= Ω(log
2+
ε
n
) for some
ε >
0. This is a pretty complicated
sort, so we will build the algorithm from the ground up. First, we give an algorithm for sorting
bitonic sequences using methods from parallel computing.
Second, we show how to merge two
words of
k
≤
log
n
log log
n
elements in
O
(log
k
) time.
Third, using this merge algorithm, we
create a variant of mergesort called
packed sorting
, which sorts
n b
bit integers in
O
(
n
) time when
w
≥
2(
b
+ 1) log
n
log log
n
. Fourth, we use our packed sorting algorithm to build signature sort.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '10
 ErikDemaine
 Data Structures, LG, signature sort

Click to edit the document details