



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of Introduction to Algorithms which includes Expensive Operations, Sort Edges, Running Time, Upshot, Union, Makeset, Disjoint Set, Disjoint Set Union, Naïve Implementation etc. Key important points are: v
Typology: Slides
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















Review: Choosing A Hash Function
Review: Universal Hashing
● A family of hash functions ς is said to be
Review: Order Statistic Trees
M 8
C 5
P 2
Q 1
A 1
F 3
D 1
H 1
Selection On OS Trees
M 8
C 5
P 2
Q 1
A
1
F 3
D 1
H 1
OS-Select Example
M 8
C 5
P 2
Q 1
A 1
F 3
D 1
H 1
OS-Select(x, i)
{
r = x->left->size + 1; if (i == r) return x; else if (i < r) return OS-Select(x->left, i); else return OS-Select(x->right, i-r);
}
OS-Select Example
M 8
C 5
P 2
Q 1
A 1
F 3
D 1
H 1
OS-Select(x, i)
{
r = x->left->size + 1; if (i == r) return x; else if (i < r) return OS-Select(x->left, i); else return OS-Select(x->right, i-r);
}
i = 5 r = 6
OS-Select Example
M 8
C 5
P 2
Q 1
A 1
F 3
D 1
H 1
OS-Select(x, i)
{
r = x->left->size + 1; if (i == r) return x; else if (i < r) return OS-Select(x->left, i); else return OS-Select(x->right, i-r);
}
i = 5 r = 6
i = 5 r = 2
i = 3 r = 2
OS-Select Example
M 8
C 5
P 2
Q 1
A 1
F 3
D 1
H 1
OS-Select(x, i)
{
r = x->left->size + 1; if (i == r) return x; else if (i < r) return OS-Select(x->left, i); else return OS-Select(x->right, i-r);
}
i = 5 r = 6
i = 5 r = 2
i = 3 r = 2
i = 1 r = 1
OS-Select
OS-Select(x, i)
{
r = x->left->size + 1;
if (i == r) return x;
else if (i < r)
return OS-Select(x->left, i);
else
return OS-Select(x->right, i-r);
}
Determining The
Rank Of An Element
M 8
C 5
P 2
Q 1
A
1
F 3
D 1
H 1
Determining The
Rank Of An Element
M 8
C 5
P 2
Q 1
A
1
F 3
D 1
H 1
Determining The
Rank Of An Element
M 8
C 5
P 2
Q 1
A
1
F 3
D 1
H 1