|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
Credits
charged
|
|
|
| |
one
credit is charged for
|
|
|
|
each
Union
|
|
|
| |
log*(n)
credits are charged
|
|
|
|
for
each Find
|
|
|
| |
n
log*(n) credits are initially
|
|
|
charged
to the set of nodes
|
|
| |
Its
clear that a total of
|
|
|
|
O(n
log*n) credits are
|
|
|
|
charged
for n operations
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
Credits
paid
|
|
|
| |
one
credit is paid to do a
|
|
|
|
Union
|
|
|
| |
for
Find, we follow a path,
|
|
|
|
moving
from each node v to
|
|
|
the
parent of v
|
|
|
|
|
Pay
a credit from the
|
|
|
|
Find
if v is the root, if the
|
|
|
parent
of v is the root, or
|
|
|
if
the parent of v is not in
|
|
|
vs
rank-group
|
|
|
|
|
Pay
a credit from v
|
|
|
|
otherwise
|
|
|
|