Algebraic Structures and Operator Calculus
www.pdfgrip.com
Mathematics and Its Applications
Managing Editor:
M . HAZEWINKEL
Centre for Mathematics and Computer Science, Amsterdam, The Netherlands
Also of interest:
Algebraic Structures and Operator Calculus . Volume I.- Representations and Probability
Theory, by P. Feinsilver and R . Schott, 1993, x + 224 pp., ISBN 0-7923-2116-2, MAIA 241 .
Volume 292
www.pdfgrip.com
Algebraic Structures
and Operator Calculus
Volume II :
Special Functions
and Computer Science
by
Philip Feinsilver
Department of Mathematics,
Southern Illinois University,
Carbondale, Illinois, U.S.A .
and
Rene Schott
CRIN,
Universite; de Nancy 1,
Vandoeuvre-les-Nancy, France
1
0
KLUWER ACADEMIC PUBLISHERS
DORDRECHT / BOSTON / LONDON
www.pdfgrip.com
A C .I .P. Catalogue record for this book is available from the Library of Congress .
ISBN 0-7923-2921-X
Published by Kluwer Academic Publishers,
P.O . Box 17, 3300 AA Dordrecht, The Netherlands .
Kluwer Academic Publishers incorporates
the publishing programmes of
D . Reidel, Martinus Nijhoff, Dr W . Junk and MT? Press.
Sold and distributed in the U .S .A. and Canada
by Kluwer Academic Publishers,
101 Philip Drive, Norwell, MA 02061, U.S.A .
In all other countries, sold and distributed
by Kluwer Academic Publishers Group,
P.O. Box 322, 3300 AH Dordrecht, The Netherlands .
Printed on acid free paper
All Rights Reserved
® 1994 Kluwer Academic Publishers
No part of the material protected by this copyright notice may be reproduced or
utilized in any form or by any means, electronic or mechanical,
including photocopying, recording or by any information storage and
retrieval system, without written permission from the copyright owner .
Printed in the Netherlands
www.pdfgrip.com
To our parents
In memoriam : Leo and Cecilia, Joseph and Anne
www.pdfgrip.com
Table of Contents
Preface
ix
Introduction
I . General remarks
II . Some notations
III . Orthogonal polynomials and continued fractions
IV . Bessel functions, Lommel polynomials, theta functions
V . Some analytic techniques
VI . Polynomials : reference information
1
2
3
5
7
9
Chapter 1 Basic Data Structures
I . Basic data structures
II . Dynamic data structures
14
18
Chapter 2 Data Structures and Orthogonal Polynomials
I . Dynamic data structures : Knuth's model
II. Mutual exclusion
III. Elements of duality theory
24
49
52
Chapter 3 Applications of Bessel Functions and Lommel Polynomials
I. Analysis of the symbol table in Knuth's model
II . Analysis of some concurrent algorithms
54
65
Chapter 4 Fourier Transform on Finite Groups and Related Transforms
I . Basic definitions and properties
76
II . Fourier transform on finite abelian groups
89
III . Krawtchouk polynomials and finite probability theory 91
IV . Appell states
99
V . Orthogonal polynomial expansions via Fourier transform 104
Chapter 5 YoungTableaux and Combinatorial Enumeration in Parallel
Processing
I . Representations of the symmetric group
112
II . Clustering distributions
122
III . Inversion of circulants
129
IV . Young tableaux and combinatorial enumeration in parallel processing 136
References
139
Index
145
vii
www.pdfgrip.com
Preface
In this volume we will present some applications of special functions in computer
science . This largely consists of adaptations of articles that have appeared in the literature .
Here they are presented in a format made accessible for the non-expert by providing some
context . The material on group representations and Young tableaux is introductory in
nature . However, the algebraic approach of Chapter 2 is original to the authors and has
not appeared previously. Similarly, the material and approach based on Appell states, so
formulated, is presented here for the first time .
As in all volumes of this series, this one is suitable for self-study by researchers . It is
as well appropriate as a text for a course or advanced seminar .
The solutions are tackled with the help of various analytical techniques, such as generating functions, and probabilistic methods/insights appear regularly . An interesting
feature is that, as has been the case in classical applications to physics, special functions
arise - here in complexity analysis . And, as in physics, their appearance indicates an
underlying Lie structure .
Our primary audience is applied mathematicians and theoretical computer scientists .
We are quite sure that pure mathematicians will find this volume interesting and useful as
well .
We expect this volume to have a utility between a reference and a monograph . We
wish to make available in one volume a group of works and results scattered in the literature
while providing some background to the mathematics involved which the reader will no
doubt find appealing in its own right .
The authors gratefully acknowledge AFCET, Universite de Nancy I, Southern Illinois
University, INRIA, and NATO, for support while various parts of this work were carried
out .
ix
www.pdfgrip.com
INTRODUCTION
General remarks
In this volume, we present some applications of algebraic, analytic, and probabilistic
methods to some problems in computer science. Special functions, notably orthogonal
polynomials, and Bessel functions will appear.
In Chapter J, we present the basic data structures we will be studying and introduce
the ideas guiding the analysis. Chapter 2 presents applications of orthogonal polynomials
and continued fractions to the analysis of dynamic data structures in the model introduced
by J. Frangon and D.E. Knuth, called Knuth's model. The approach here is original
with this exposition. The underlying algebraic/analytic structures play a prominent role.
Chapter 3 presents some results involving Bessel functions and Lommel polynomials arising
from a study of the behavior of the symbol table. Then, in another direction, theta
functions come up as solutions of the heat equation on bounded domains, describing the
limiting behavior of the evolution of stacks and the banker's algorithm. In Chapter 4 we
present some basic material on representations of finite groups, including Fourier transform.
Then Fourier transform is considered in more detail for abelian groups, particularly cyclic
groups. Next we look at Krawtchouk polynomials, which arise in a variety of ways, e.g.,
in the study of random walks. The concluding Chapter 5 discusses representations of the
symmetric group and connections with Young tableaux. Then, a variety of applications of
Young tableaux are shown, including examples related to questions in parallel processing.
Chapters 4 and 5 mainly include material from the literature that we find particularly
interesting as well as some new approaches. It is hoped that the reader will find these
chapters to be useful as background for further study as well as providing examples having
effective illustrative and reference value.
R e m a r k . The remainder of this introductory chapter provides some basic information
that the reader may find useful, and is included so that the volume is fairly self-contained.
Here one can find the notational conventions used in this volume; they are consistent
with those of Volume 1. Many formulas and much information may be found in the
Handbook by Abrajnowitz&Stegun [2], an overall very handy reference for the material of
this chapter and for properties of the special functions used throughout this volume. Also,
see Rainville[73].
www.pdfgrip.com
2
INTRODUCTION
II.
Some notations
1. First, we recall the gamma and beta functions, given by the integrals
r(x)= /
Jo
t^-ifi-'dt
(2.1)
r(x + y)
Jo
for R e x , Hey > 0.
2. In hypergeometric functions, we use the standard Pochammer notation:
(^)'^
r(a + 6)
r(a)
where T denotes the gamma function. Thus, we have for binomial coeiEcients:
©=<-"'
A:!
3. For hypergeometric functions
A ^ v ^ (ai)n(a2)n---(ap)n x"
a i , a ^ , . . . , dp
for integer p,q >0. For example, we have
(fl)n(fe)«
2-ro
n
71 = 0
= 1 + a6a; + a ( a + 1 ) 6 ( 6 + l ) i V 2 + --4. For Stirling numbers, we use Sn,k and s^^k for Stirling numbers
second kinds, respectively. They may be defined by the relations:
of the first and
(x)„ = Y^S„,kx''
k=0
'Tn
x" = ^ . „ , t ( - l ) " - * ( x ) ,
t=o
See Knuth[53], p. 65fF. (where, however, a different notation is used).
5. For finite sets E, we denote the cardinality of E by \E\ or # E .
(2-2)
www.pdfgrip.com
INTRODUCTION
III.
3
O r t h o g o n a l p o l y n o m i a l s and continued fractions
Orthogonal polynomials arise frequently as solutions to three-term recurrence relations.
A standard reference on orthogonal polynomials is Szego[81]. For our work Chihara[10] is
a useful reference as well.
3.1
ORTHOGONAL POLYNOMIALS
Given a bounded, nondecreasing function F{x) on R , we define a corresponding Stieltjes
measure dF{x). The moments
of dF are defined by
We will take F to be normalized so that ^o = 1- It is assumed that the moments exist for
all n > 0. Integration with respect to dF, m,athem,atical expectation or expected value ,
is denoted by angle brackets ( • )
{f(X))= r
f(x)dF(x)
(3.1.1)
J — CO
in particular, we can write the moments as Hn = {X"). In the discrete case, we have a
probability sequence (discrete distribution), {pk }k>o, satisfying p* > 0, ^ p ^ t = 1, with
corresponding moments
/^n =
Y^(ak)"pk
k=0
where at denotes the value taken on with corresponding probability pk- In the (absolutely)
continuous case, we have a nonnegative density function p{x), and
fJ'n =
I
x"
J — oo
p{x)dx
We define an inner product (•, •} on the set of polynomials, which is the mathematical
expectation of their product. On the basis { x" }, this is given in terms of the moments:
{X",X"'} = ( X " . X ' " ) = /
X^-X"" dF{x) = fXn+m
J — oo
The corresponding sequence of orthogonal polynomials, { <j>„{x) }n>Oi say, may be determined by applying the Gram-Schmidt orthogonalization procedure to the basis { a;" }. The
polynomials { <f>n{x) } satisfy
M^)^m{x)dF{x) = n"'
^ , ^
(3.1.2)
www.pdfgrip.com
4
INTRODUCTION
where 7„ are the squared norms. We normalize 70 to 1.
With (f>„{x) = x" + • • •, monic polynomials, the { <j>„{x) } satisfy a three-term recurrence relation of the form:
X<f>Ti=
0,n<t>n-'rhn4>„-l
(3.1.3)
with ?io = 1, (^1 = X — ao. Orthogonality, comparing (a;i^„,(^„_i) = 6n7n-i with
{4>n,x4in-\) = 7n, yields the relation:
ln=Wh---hn
3.2
(3.1.4)
CONTINUED FRACTIONS
A general reference for continued fractions is Jones&Thron[47]. Two sequences of (real
or complex) numbers { a„ }n>i> { ^n }n>o determine a continued fraction:
6o -I- ai hi -f- 02/62 + . . . + a„/fe„ -H . . .
which is the limit as n —» oo of the
approximants:
—^ = 60 + 0.1 ^bi + 02/62 + • - • + a„/bn
P„ and Q„ are the n"" partial numerators and partiaJ denominators, respectively. They
satisfy the recurrence relations:
U„ = b„Un-l + anUn-2
(3.2.1)
with initial conditions
P _ i = l , Po=6o,
g _ i = 0 , Qo = l
respectively. One may remark that this setup corresponds to the matrix relations:
5n
Q
Pn
J
\an
b„J
\ai
bi J \1
bo J
www.pdfgrip.com
INTRODUCTION
3.2.1 Connection
5
with orthogonal
polynomials
Consider the continued fraction
1 / l - aox - Wx^ j l -axx-
hix'^ j ... j l - a „ _ i z - 6„a;^ / . . .
(3.2.1.1)
From equation (3.2.1), the partial numerators and denominators satisfy
"n+i = (1 - a.nx)un - &„a;^t<„_i
for n > 1, where the numerator poJynomiais, P„{x), satisfy the initial conditions PQ = 0,
Pi = 1, and the denominator polynomials, Qn{x), satisfy Qo = 1, Qi = 1 — aox.
The reciprocal polynomials, j/'„(a;), defined as
M^)
=
^"Qn{l/x)
satisfy the three-term recurrence
xtj^n = ipn+i + a„tl;„ + b„'ipn-.t
(3.2.1.2)
with initial conditions I/JO = 1, V"! = ^^ — tio- These give a sequence of orthogoned polynomials with squared norms 7n = &1&2 • • • 6„, n > 0.
IV.
4.1
B e s s e l functions, L o m m e l p o l y n o m i a l s , t h e t a functions
BESSEL FUNCTIONS AND LOMMEL POLYNOMIALS
The reader is referred to G.N. Watson's [84] treatise for an extensive presentation of
the theory of Bessel functions. Here we indicate the features that are important for our
applications.
The Bessel function J„ is defined by :
..M = (./yE„'r'ritt)
. . . . J r ( n + « + l)
<"•"
This function arises as the solution of the differential equation
cPu
1 du
/.
v^
In the present study, a principal feature of Bessel functions is the fundamental recurrence:
2iyz-'j^{z)
= J^+i{z) + J.-i{z)
(4.1.3)
www.pdfgrip.com
6
INTRODUCTION
Iterating this recurrence, Lommel polynomials come up as the coefficients expressing
J^j^„(z) as a linear combination of Jv{z) and Jv-i(z)'.
This holds for nonnegative integer n. F o r n = 1, wehave/li,i,(z) = 2i^/2r, while i?o,i/(-2) = 1The Lommel polynomials satisfy the recurrence
2z-'^{n + v)R„=
R„+i + Rn-i
with the initial conditions i i _ i = 0, iio = 1- The i?„ may be given explicitly in the form
[«/2] /
,x
, .
/„x
«..W^ g (";')(-)* ^ 0 )
n-2k
*:=0
They are used to solve the recurrence
X ^ n = V'n+l + e ~ ' " V ' n + ^ n - l
(4.1.5)
which has as general solution
i>„ - CiJ?„,_£^{-2e) - C2iZn-i,i-£2:(-2e)
i.e., with initial values ^ _ i = C2, 'o — c\- Eq. (4.1.4) can be interpreted as expressing the
solution to x-\\)n — ^n+\ + e~^nipri + «/'n-i in the form
Jn^ex(~2e)
= J-^^{-2e)R„,-exi-2s)
- J-i^,^{~2e)Rn-i,i-exi-2£)
which combines features of both eqs. (4.1.3), (4.1.4).
4.2
THETA FUNCTIONS
The four Jacobi theta functions
are given by
oo
^i{z,q)=
Y,
(-l)"9^"+^''^''sin(2n + l)2
? l = —OO
OO
,?2(2,g)=
Yl
9^"+'^'''cos(2n + l)z
n = —OO
oo
^3(-^,?)=
2v
^"
cos2nz
n = —oo
oo
M^^l)=
Y
(-l)"9"'cos2n^
(4.1.6)
www.pdfgrip.com
INTRODUCTION
V.
7
S o m e analytic techniques
Here we indicate some basic analytic techniques that will be used. Included are: asymptotic behavior of coefficients of a power series, central limit approximation of sums involving
binomial coefficients, and Lagrange inversion.
5.1
BASICS OF ASYMPTOTICS
oo
Let f{z) — 2_^ Onz" be analytic in a neighborhood of 0 in the complex plane. We are
n=0
interested in the behavior of |a„| as n ^ oo. The easiest observation is:
oo
5.1.1 P r o p o s i t i o n .
Let f{z) = V^ ctn-^" be analytic in a disk of radius R > 1. Then
n=0
the coefficients an decrease exponentially
fast.
Proof: The terms of the series 2 ^ Q |c(„|(iJ — e)" converge to zero for any e > 0.
Choose e so that R~ e > 1.
•
Because of this, one looks for the singularities of functions when it is known that the
coefficients a„ grow as n —» oo. For our purposes, the following suffices.
5.1.2 L e m m a . Let f{z) = S ^ o * * " ^ " ^'^ meromorphic, analytic in a neighborhood of
0 in the complex plane. Let ^ denote the pole of f nearest to the origin. If ( is a poJe of
order p, then we have the estimate
,
,
A
nP-i
r(p) c"+p
where A = lim f(z){z
Proof:
— C)*".
Write g{z) = f{z) • {z - CY- So A = g{0 and
where the second term has at most a pole of order < p. Now, for \z\ < |C|, the binomial
theorem implies
At a pole of larger modulus, the same estimate gives a rate of growth exponentially slower,
•
whereas terms of lower order poles grow at correspondingly lower powers of n.
See Flajolet-Vitter[28] for more along these lines.
www.pdfgrip.com
8
5.2
INTRODUCTION
CENTRAL LIMIT APPROXIMATION
The central limit approximation is a detailed application of the theorem of DeMoivreLaplace that one can approximate sums involving binomial coefficients, interpreted as
taking expectations with respect to binomial distributions, by Gaussian integrals. Here is
a useful version.
5.2.1 L e m m a .
Let f be a polynomial.
Then, as N —* oo,
Another formulation of the same statement is:
N \
/' N
k + N/2) ^ \N/2
where k = avN.
In particular, we have
5.2.2 L e m m a .
For p > 0, as iV —> 00,
2-2"'
y/Nda
2 / ^ 1 / 1
.,4-',,^
|*|
Proof:
{k
+ N/2j
^
' •"
\NI2)
\
' /
»
^
^V
This follows from the above remarks and the Gaussian integral
J.OO
oo
/
a'^'e-^'^" da = 2
-00
a^^g-^"' da
Jo
= 7rTT7^ /
t^-'^'e-'dt
2P+1/2 y^,
= ^ r ( p + i/2)
via the substitution t = 2a^. The result follows, using r ( | ) = y/n.
•
See Canfield[9] for more information on this topic.
5.3
LAGRANGE INVERSION
Given a function, / , analytic in a neighborhood of XQ, that is locally one-to-one, write
y = f{x). Lagrange inversion provides a way of finding expansions of functions of x in
terms of the variable y. In particular, the relation x = f~^{y) is the inverse of / . The idea
is that we want the expansion in terms of y of any function g{x) analytic in a neighborhood
of xo.
www.pdfgrip.com
INTRODUCTION
5.3.1 P r o p o s i t i o n .
Let y = f{x) be anaJyfic near XQ, yo = f{xo), with / ' ( x o ) 7^ 0.
For g analytic near xo, the Lagrange inversion formula gives the expansion
k-\
^
k=l
See Sansone-Gerretsen[79] for details.
integration by parts.
VI.
I,
s
'
I
Xo
X
fix)
- yo
The proof uses Cauchy's integral formula and
P o l y n o m i a l s : reference information
Here we include some basic reference material on the classes of orthogonal polynomials
that come up, notably in the study of dynamic d a t a structures. In general, references are
Szego[81] and Chihara[10].
First we note
1. The inner product is denoted by angle brackets (•,•), thus
f(x)gix)dFix)
-00
In particular, for an orthogonal sequence {<!>„}, we have
{<l>n,4>m) = j
'i>nix)(j>mix)dF{x)
=Jn6„m
J —00
where 6nm is Kronecker's delta equal to 1 if n = m, 0 otherwise, and 7„ are the
squared norms.
2. The moment generating function
denotes a generating function for the sequence
of moments {^n }• Note that for symmetric distributions, where the odd moments
vanish, we often write the generating function for { n^n }•
6.1
POLYNOMIALS CORRESPONDING TO DISCRETE DISTRIBUTIONS
Here we list basic information on polynomials orthogonal with respect to the binomial
and Poisson distributions, respectively.
• Binomial distribution — Krawtchouk polynomials { Kn{x) }
Recurrence formula
X Kn - A'„+i + n{N - n + l)A'„_i
with A'o = 1, K\ = X.
www.pdfgrip.com
10
INTRODUCTION
Measure of orthogonality and squared norms
{Kn, Km) = 2-^^ ^
jn =
( , )K,,{2k
- N)Kmi2k
- N) = y„ 6„^
n\{-in-N)„
Moment generating function
V —r/^n = (cosh 5 ) ^
Generating function for the polynomials
N
T ^ K„(x) = (1 + t,)(^+^)/^(l - vY^-^y'
n=0
Formula for the Krawtchouk polynomials
lt=0
• Poisson distribution — Poisson-Charlier polynomials { P„{x,t) }
Recurrence formula
xPn=
Pn+l
+ (< + n)Pn
+
tuPn-l
with Po = 1, Pi = a ; - t .
Measure of orthogonality and squared norms
{Pn, P,n)
=e-'
^
4=0
-
Pnik)Pm{k)
= 7 „ Sr,
•
7n = n\r
Moments
/in =
Y^Sn^kt''
k
Moment generating function
V
n=0
—Ain = e x p ( i ( e ' - 1 ) )
n
www.pdfgrip.com
INTRODUCTION
11
Generating function for the polynomials
n=0
Formula for the Poisson-Charlier polynomials
P„(x,0 = (-ir^(")<"-*(-a.)*
jfc=o ^
^
R e m a r k . The moments for the Poisson distribution are readily calculated by considering
/•oo
/
oo
y^ dF[x) = e-*
V
k=0
Differentiating n times with respect to j / , then setting y — 1, yields
/
Jo
xix-l)---{x-n
+ l)dF{x)=
( - l ) " ( - x ) „ d F ( T ) = <"
Jo
Then the Stirling numbers of the second kind, eq. (2.2), convert these to the usual moments
given above.
6.2
POLYNOMIALS CORRESPONDING TO CONTINUOUS DISTRIBUTIONS
Here we have Tchebychev and Hermite polynomials. Recall that the Tchebychev polynomials are determined according to
T„(cos $) = cos nO,
Un{cos 9) = sin(n + \)9/ sin 6
The Hermite polynomials are orthogonal with respect to the Gaussian distribution.
• Tchebychev polynomials of the first kind { T„(a;) }
Recurrence formula
2x Tn = T„-^.l + Tn-i
with To = 1, Ti = X.
Measure of orthogonality and squared norms
1
f^
dx
TT J-1
7n = 2 '
V l
^^'^
-
X^
www.pdfgrip.com
12
INTRODUCTION
Moments
Moment generating function
yr^
n=0
Generating function for the polynomials
1 — XV
^'"^'M-T^^^.
71 = 0
Formula for the Tchebychev polynomials of the first kind
[n/21
• Tchebychev polynomials of the second kind { U„{x) }
Recurrence formula
2xUn
with Uo =l,Ui
=U„+i+Un-l
= 2x.
Measure of orthogonality and squared norms
2
{Un,Um)
yi
—— /
7n = 1 ,
Uriix)Um{x)\/l
n>Q
Moments
Moment generating function
2^ S
/^2n - 2
Generating function for the polynomials
- x'^ dx =
'y„S„„
www.pdfgrip.com
INTRODUCTION
13
Formula for the Tchebychev polynomials of the second kind
[n/2]
k/n^\n-2k
*:=0
^
^
• Gaussian distribution — Hermite polynomials { Hn{x,i)
Recurrence formula
xH„ = Hn+i +
inHn-i
with Ho = 1, ffi = X.
Measure of orthogonality and squared norms
-oo
7n = n\t"
Moments
n,l^
^2n = ( 2 0 " ( | ) n =
Moment generating function
n=0
Generating function for the polynomials
. n!
Formula for the Hermite polynomials
[n/2]
^ ' / r) \
k=0 ^
^
( 2 » ) ! .n
^ ^ <
}
www.pdfgrip.com
Chapter 1
BASIC DATA S T R U C T U R E S
In this Chapter are introduced the basic data structures that will be the principal subject of the first two chapters (and part of Chapter 3). First, we introduce basic terminology
and constructions. In Chapter 2, detailed computations and results will be presented.
The structures discussed here are representations of files or lists of data stored in
a computer. The idea is to organize the data for ready access and effective use of the
information.
I.
Basic d a t a s t r u c t u r e s
We start with a universe of elements, items. It is assumed that one can equip the universe
with a total order. Once given an order structure, the items are referred to as keys
1.1 Definition.
A list
is a sequence of items.
When the items can be ordered, i.e., when the list consists of keys, then one has a sorted or
unsorted list accordingly. Particular data types are determined according to operations
used to construct corresponding lists. A sequence of operations performed on a given
structure is represented as a word in a language with alphabet corresponding to the
operations allowed to be performed on the data structure. Here we consider structures
which permit insertions
denoted by J, deletions , denoted D, and record searches
(examining items for information) called queries
denoted Q"*" or Q~ according as the
result of the search was positive (successful) or negative (unsuccessful). This gives a basic
alphabet
{I,D,Q+,Q-}.
R e m a r k . Since the words can be of arbitrary length, one could consider the set of infinite
sequences of letters, restricting to the subclass of tame sequences, having all but finitely
many components equal to e the 'empty symbol', denoting a blank, which thus would be
adjoined (formally) as part of the alphabet.
1.1
LINEAR LISTS AND DICTIONARIES
A basic structure of interest is the linear list. This is a list which is constructed using
only insertions and deletions.
1.1.1 Definition.
A linear list
is a list that admits the operations / and D only.
For purposes of illustration, we denote the items by lowercase letters { a, 6, c , . . . } and the
corresponding operations as a word using the alphabet { I,D}. For example, starting from
abc, inserting d, e, / , then deleting a and / might give successively: dabc, dabec, dabfec,
dbfec, dbec, corresponding to the word IIIDD.
It is clear that many different lists may
correspond to a given sequence of operations. A main feature of the analysis is how to
deal with precisely this fact in determining the complexity of a particular structure.
Probably the simplest and most well-known example of a lineax list is the stack.
www.pdfgrip.com
BASIC DATA STRUCTURES
15
1.1.2 Deflnition.
A stack is a linear list for which the insertions and deletions are
all made at only one end of the list.
For a stack, a given word corresponds to only one possible set of consequences. In the
above example, after three insertions, the deletions would necessarily indicate removal of
/ and then e from the list.
1.1.1
Queues
Another important class of structures are queues.
1.1.1.1 Definition.
A queue is a linear list for which insertions are made at one end
of the list and deletions are made at the other end.
As with a stack, a series of operations corresponds to only one possible set of consequences.
An important modification is the priority queue. We assume that the items are keys,
i.e., come from a totally ordered universe. In the priority queue, only the highest priority
item can be deleted, with priority according to the ordering of the keys.
1.1.1.2 Definition.
A priority queue is a linear list of keys for which only the minimal
key may be deleted. Insertions are unrestricted.
1.1.2
Dictionaries
Dictionaries are modelled on the everyday notion of dictionary, i.e., queries, corresponding
to looking up information, arise. Thus, all four operations I, D, Q"*", Q~ are admitted.
The elements are keys.
1.1.2.1 Definition.
Q+, Q--
A dictionary
is a list of keys admitting the four o p e r a t i o n s / , Z),
A queue/dictionary structure that gives rise to an especially interesting mathematical
analysis is the symbol table. Here positive queries are admitted, but only the last key
inserted may be deleted. I.e.,
1.1.2.2 Definition.
A symbol table is a list of keys admitting the three operations
/ , D, Q"*". Deletions operate only on the last (most recent) key inserted.
At this point it is not clear which structure is the most effective in a given situation.
The question is how to determine what practical implementations are most efficient. In
the next section we consider some basic data organizations
— how the structures are
implemented in the machine. The mathematical analysis, average case analysis, gives one
an idea of the relative efficiency of the various data organizations.
www.pdfgrip.com
16
1.2
CHAPTER 1
IMPLEMENTATIONS
We will be concerned primarily with linear lists, priority queues, dictionaries, and
symbol tables. Each of these data types may be implemented as sorted lists, for keys, as
well as unsorted lists. Additionally there are various implementations available for these
structures. Below, we illustrate the use of pagodas, a structure developed by Fran^on,
Viennot& Vuillemin [35].
R e m a r k . Sorting algorithms are a good example of the differences that can arise between
worst-case and average-case behavior. Consider the most efficient sorting algorithm, 'quicksort', developed by C.A.R. Hoare. Analysis shows that this algorithm sorts a sequence of
n elements in an average time of the form O ( n l o g n ) , i.e., bounded by a constant times
n log 77. Comparison among all sorting algorithms yields the conclusion that quicksort is
the most efKcient on the average. However, the worst case, when the data is almost in
order at the start, is quite poor, taking on the order of n^ steps. Fortunately these worst
cases are rare. See Knuth[53], v. 3, p. 114ff.
For priority queues, in addition to sorted and unsorted lists, there are implementations
as binary tournaments and pagodas. The idea of these structures is to take advantage of
the priorities among the items.
Here we identify a priority queue of size n with a permutation of the integers from 1
to n, the keys. To these correspond labelled, rooted trees. The labels are the keys 1 , . . . , n.
First we recall the definition of a binary tree . A binary tree T is given recursively as
a triple T = {l{T),v{T),r{T))
where l(T) and r{T) are binary trees, the left and right
subtrees respectively of T, and v(T) is the label (value) of the root of T. The empty
tree is included in the definition of a binary tree. Similarly, a binary tournament
is
defined recursively by the condition that the left and right subtrees of the root are binary
tournaments satisfying v{T) < min{ v{(): ( a node of 1{T) or r{T) }. In other words, for
any node (, its sons (' satisfy v{() < v{^'), priority increasing with the depth of the node.
R e m a r k . Various types of tournaments have been designed depending on the constraints
imposed. Heaps, AVL trees, 3-2 trees, binomial queues are among the most well known.
See Aho, Hopcroft&; Ullman[3], Knuth[53], Mehlhorn&Tsakalidis[68] for full discussions.
For example, consider the queue (permutation) 573961428. Successively taking out
the minimal values, partitioning accordingly, and otherwise keeping order, leads to the
following binary tournament:
1
/
\
3
2
/
\
^
5
6
\
^
7
9
4
\
8
www.pdfgrip.com
BASIC DATA STRUCTURES
17
or, adjoining O's so that every node has left and right subtrees, this can be represented by
the set of triples
a = (c,l,6)
d = (0,4,0)
g=
(0,7,0)
h={d,2,h)
e = (0,5,5)
/i = (0,8,0)
c = (e,3,/)
/=(»,6,0)
i = (0,9,0)
For example, 6 = (d, 2, h) indicates that the node 2 has attached left subtree d ajid right
subtree h.
1.2.1 Pagodas
Now we are ready for the construction of pagodas. Start with a binary tournament T,
given as a set of triples (as above). The pagoda representation is a set of triples determined
as follows. For each subtree P, determine the left inverse subtree l''^{P) as the unique
subtree, Q, say, such that 1{Q) = P in the triple corresponding to Q. For example, in the
tournament of the previous section, we have /~^(e) = c. Similarly, determine the right
inverse subtree of P. Next, define recursively the leftmost descendant of a subtree P as
follows
i*( p> _ / -P'
if KP) is empty
I ^*{KP)),
otherwise
r*{P) is defined correspondingly. (Here, empty subtrees correspond to the O's in the triples
used in the representation given above for tournaments.) Now we have
1.2.1.1 Definition.
Let T be a binary tournament. A •pagoda is a representation of
T as a set of triples (A(P), w(P), p{P)), one for each nonempty subtree P of T, such that
\(p\^i^~\P)^
^ ^ \l\P),
if r ^ P ) exists
otherwise
p(P)=(''~'(-P)'
r*[P),
i f ' - " H ^ ) exists
otherwise
and
Briefly, for each subtree locate its (left or right) ancestor if there is one; if none, then
give its furthest descendant. For example, the pagoda representation for the tournament
considered above is given by:
a = ( e , l,/i)
d=(6,4,d)
g = {g,7,e}
b = (d, 2,a)
e = (c, b,g)
h = (h, 8, ft)
c=(a,3,/)
f = {i,6,c)
t =
{f,9,i)
Frangon, Viennot&Vuillemin[35] proved that, for implementing priority queues, the
pagoda has the best average complexity (see §1.5 of Chapter 2).
www.pdfgrip.com
18
II.
CHAPTER 1
Dynamic data structures
The motivation for studying dynamic data structures is to compare the efficiency of
the various data structures as implemented. How is one to analyze the behavior of these
systems? Two basic ideas are time costs and space costs, involving respectively the complexity due to the number of operations involved and the complexity due to storage —
memory — requirements. Here we study time costs.
2.1
HISTORIES
We present a useful formalism. Let O denote the alphabet of operations, in our case we
have O C {I,D,Q'^,Q~
}. Thus, a word means a sequence of elements belonging to O.
We denote the set of words over the alphabet O hy O*. We want to count the number of
operations involved when the operations are performed on files under constraints imposed
according to the various data structures. First, we make a general definition, corresponding
to the necessary condition that a file cannot be of negative size.
2.1.1 Definition.
appears in w.
For w £ O* and O £ O, denote by \w\o the number of times O
2.1.2 Definition.
For w e C*, the height
of w,/i(w), is defined by
h{'w) = \w\i -
\W\D
Note that the difference between the number of insertions and deletions is just the size of
the file. Now we have
2.1.3 Definition. A schema is a word w = O1O2 • • • On € O* such that the sequence
of subwords Wi = O1O2 • • -Oi satisfies h(wi) > 0, for all i, 1 < i < n.
When counting file operations involving keys, we consider only their relative order.
The method of counting the number of ways an operation can be applied to a given file in a
given situation is determined by a sequence of nonnegative integers, ranks, corresponding
to (the relative ordering of) keys.
2.1.4 Definition.
Let ri,...,r„
be a sequence of nonnegative integers, ranks . A
history is a sequence of ordered pairs { ( O i , r i ) , . . . ,{0„,r„) } such that O1O2 • • On is a
schema and r j , . . . , r „ are admissible ranks (for a given model).
The ranks allowed determine the particular models. Below, we discuss two models that
have been studied: the maricovian model and Knuth's model. So a model is determined
by the alphabet O and, for each data structure, the specification of allowed histories. (In
Chapter 2, detailed results for Knuth's model will be presented.)
Here we continue with a sketch of the general approach, assuming a model has been
given.