Union-Find Partition Structures

Similar documents
Union-Find Partition Structures Goodrich, Tamassia Union-Find 1

CSE 241 Algorithms and Data Structures 10/14/2015. Skip Lists

Lecture 15 First Properties of the Brownian Motion

Review Answers for E&CE 700T02

Extremal graph theory II: K t and K t,t

Moment Generating Function

Section 8 Convolution and Deconvolution

1 Notes on Little s Law (l = λw)

Big O Notation for Time Complexity of Algorithms

Ideal Amplifier/Attenuator. Memoryless. where k is some real constant. Integrator. System with memory

STK4080/9080 Survival and event history analysis

Calculus Limits. Limit of a function.. 1. One-Sided Limits...1. Infinite limits 2. Vertical Asymptotes...3. Calculating Limits Using the Limit Laws.

CSE 202: Design and Analysis of Algorithms Lecture 16

th m m m m central moment : E[( X X) ] ( X X) ( x X) f ( x)

ODEs II, Supplement to Lectures 6 & 7: The Jordan Normal Form: Solving Autonomous, Homogeneous Linear Systems. April 2, 2003

LIMITS OF FUNCTIONS (I)

Online Supplement to Reactive Tabu Search in a Team-Learning Problem

The analysis of the method on the one variable function s limit Ke Wu

BEST LINEAR FORECASTS VS. BEST POSSIBLE FORECASTS

CS623: Introduction to Computing with Neural Nets (lecture-10) Pushpak Bhattacharyya Computer Science and Engineering Department IIT Bombay

Review Exercises for Chapter 9

FIXED FUZZY POINT THEOREMS IN FUZZY METRIC SPACE

Supplement for SADAGRAD: Strongly Adaptive Stochastic Gradient Methods"

Lecture 9: Polynomial Approximations

Basic Results in Functional Analysis

The Eigen Function of Linear Systems

Conditional Probability and Conditional Expectation

C(p, ) 13 N. Nuclear reactions generate energy create new isotopes and elements. Notation for stellar rates: p 12

Actuarial Society of India

RCT Worksheets/Quizzes 1.06 Radioactivity and Radioactive Decay

Fresnel Dragging Explained

Notes 03 largely plagiarized by %khc

Comparisons Between RV, ARV and WRV

2 f(x) dx = 1, 0. 2f(x 1) dx d) 1 4t t6 t. t 2 dt i)

SUPER LINEAR ALGEBRA

Manipulations involving the signal amplitude (dependent variable).

An interesting result about subset sums. Nitu Kitchloo. Lior Pachter. November 27, Abstract

Linear Time Invariant Systems

Lecture 15: Three-tank Mixing and Lead Poisoning

ES 330 Electronics II Homework 03 (Fall 2017 Due Wednesday, September 20, 2017)

λiv Av = 0 or ( λi Av ) = 0. In order for a vector v to be an eigenvector, it must be in the kernel of λi

Longest Common Prefixes

Hadamard matrices from the Multiplication Table of the Finite Fields

Week 8 Lecture 3: Problems 49, 50 Fourier analysis Courseware pp (don t look at French very confusing look in the Courseware instead)

MATH 507a ASSIGNMENT 4 SOLUTIONS FALL 2018 Prof. Alexander. g (x) dx = g(b) g(0) = g(b),

14.02 Principles of Macroeconomics Fall 2005

N! AND THE GAMMA FUNCTION

EEC 483 Computer Organization

Chemical Engineering 374

A Note on Random k-sat for Moderately Growing k

Merge and Quick Sort

L-functions and Class Numbers

10.3 Autocorrelation Function of Ergodic RP 10.4 Power Spectral Density of Ergodic RP 10.5 Normal RP (Gaussian RP)

ECE-314 Fall 2012 Review Questions

It is often useful to approximate complicated functions using simpler ones. We consider the task of approximating a function by a polynomial.

A TAUBERIAN THEOREM FOR THE WEIGHTED MEAN METHOD OF SUMMABILITY

Applying the Moment Generating Functions to the Study of Probability Distributions

David Randall. ( )e ikx. k = u x,t. u( x,t)e ikx dx L. x L /2. Recall that the proof of (1) and (2) involves use of the orthogonality condition.

Math 6710, Fall 2016 Final Exam Solutions

Discrete-Time Signals and Systems. Introduction to Digital Signal Processing. Independent Variable. What is a Signal? What is a System?

Calculus BC 2015 Scoring Guidelines

AQA Maths M2. Topic Questions from Papers. Differential Equations. Answers

Traversal of a subtree is slow, which affects prefix and range queries.

5 Sequences and Series

Math 2414 Homework Set 7 Solutions 10 Points

B. Maddah INDE 504 Simulation 09/02/17

Disjoint set (Union-Find)

Economics 8723 Macroeconomic Theory Problem Set 3 Sketch of Solutions Professor Sanjay Chugh Spring 2017

Skip Lists. Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 S 3 S S 1

Comparison between Fourier and Corrected Fourier Series Methods

K3 p K2 p Kp 0 p 2 p 3 p

6.01: Introduction to EECS I Lecture 3 February 15, 2011

6.003: Signals and Systems Lecture 20 April 22, 2010

6.003: Signals and Systems

EXISTENCE THEORY OF RANDOM DIFFERENTIAL EQUATIONS D. S. Palimkar

Shape Analysis. Mooly Sagiv

A note on deviation inequalities on {0, 1} n. by Julio Bernués*

Chapter 10. Laser Oscillation : Gain and Threshold

9.3 Taylor s Theorem: Error Analysis for Series. Tacoma Narrows Bridge: November 7, 1940

10.1 Sequences. n term. We will deal a. a n or a n n. ( 1) n ( 1) n 1 2 ( 1) a =, 0 0,,,,, ln n. n an 2. n term.

Using Linnik's Identity to Approximate the Prime Counting Function with the Logarithmic Integral

Real Analysis Fall 2004 Take Home Test 1 SOLUTIONS. < ε. Hence lim

arxiv: v3 [math.co] 25 May 2013

F D D D D F. smoothed value of the data including Y t the most recent data.

Integrality Gap for the Knapsack Problem

MA541 : Real Analysis. Tutorial and Practice Problems - 1 Hints and Solutions

Institute of Actuaries of India

EGR 544 Communication Theory

Operating Systems Exercise 3

Dynamic Programming 11/8/2009. Weighted Interval Scheduling. Weighted Interval Scheduling. Unweighted Interval Scheduling: Review

ECE 145B / 218B, notes set 5: Two-port Noise Parameters

FORMALIZATION OF THE OBJECT CLASSIFICATION ALGORITHM

Academic Forum Cauchy Confers with Weierstrass. Lloyd Edgar S. Moyo, Ph.D. Associate Professor of Mathematics

Lecture 8 April 18, 2018

Introduction to Mobile Robotics Mapping with Known Poses

Constrained Codes for Phase-change Memories

1. Solve by the method of undetermined coefficients and by the method of variation of parameters. (4)

arxiv: v1 [math.co] 30 May 2017

Common Fixed Point Theorem in Intuitionistic Fuzzy Metric Space via Compatible Mappings of Type (K)

Chapter Chapter 10 Two-Sample Tests X 1 X 2. Difference Between Two Means: Different data sources Unrelated. Learning Objectives

Transcription:

Uio-Fid //4 : Preseaio for use wih he exbook Daa Srucures ad Alorihms i Java, h ediio, by M. T. Goodrich, R. Tamassia, ad M. H. Goldwasser, Wiley, 04 Uio-Fid Pariio Srucures 04 Goodrich, Tamassia, Goldwasser Uio-Fid Pariios wih Uio-Fid Operaios! makesex: Creae a sileo se coaii he eleme x ad reur he posiio sori x i his se! uioa,b : Reur he se A U B, desroyi he old A ad B! fidp: Reur he se coaii he eleme a posiio p 04 Goodrich, Tamassia, Goldwasser Uio-Fid

Uio-Fid //4 : Lis-based Implemeaio! Each se is sored i a sequece represeed wih a liked-lis! Each ode should sore a objec coaii he eleme ad a referece o he se ame 04 Goodrich, Tamassia, Goldwasser Uio-Fid Aalysis of Lis-based Represeaio! Whe doi a uio, always move elemes from he smaller se o he larer se Each ime a eleme is moved i oes o a se of size a leas double is old se Thus, a eleme ca be moved a mos Olo imes! Toal ime eeded o do uios ad fids is O lo. 04 Goodrich, Tamassia, Goldwasser Uio-Fid 4

Uio-Fid //4 : Tree-based Implemeaio! Each eleme is sored i a ode, which coais a poier o a se ame! A ode v whose se poier pois back o v is also a se ame! Each se is a ree, rooed a a ode wih a selfrefereci se poier! For example: The ses,, ad : 4 7 0 04 Goodrich, Tamassia, Goldwasser Uio-Fid Uio-Fid Operaios! To do a uio, simply make he roo of oe ree poi o he roo of he oher 0! To do a fid, follow seame poiers from he sari ode uil reachi a ode whose se-ame poier refers back o iself 0 04 Goodrich, Tamassia, Goldwasser Uio-Fid

Uio-Fid //4 : Uio-Fid Heurisic! Uio by size: Whe performi a uio, make he roo of smaller ree poi o he roo of he larer! Implies O lo ime for performi uio-fid operaios: Each ime we follow a poier, we are oi o a subree of size a leas double he size of he previous subree Thus, we will follow a mos Olo poiers for ay fid. 0 04 Goodrich, Tamassia, Goldwasser Uio-Fid 7 Uio-Fid Heurisic! Pah compressio: Afer performi a fid, compress all he poiers o he pah jus raversed so ha hey all poi o he roo 0 0! Implies O lo * ime for performi uio-fid operaios: Proof is somewha ivolved ad o i he book 04 Goodrich, Tamassia, Goldwasser Uio-Fid 4

Uio-Fid //4 : Java Implemeaio 04 Goodrich, Tamassia, Goldwasser Uio-Fid Java Implemeaio, 04 Goodrich, Tamassia, Goldwasser Uio-Fid 0

Uio-Fid //4 : Proof of lo* Amorized Time! For each ode v ha is a roo defie v o be he size of he subree rooed a v icludi v ideified a se wih he roo of is associaed ree.! We updae he size field of v each ime a se is uioed io v. Thus, if v is o a roo, he v is he lares he subree rooed a v ca be, which occurs jus before we uio v io some oher ode whose size is a leas as lare as v s.! For ay ode v, he, defie he rak of v, which we deoe as r v, as r v [lo v]:! Thus, v rv.! Also, sice here are a mos odes i he ree of v, r v [lo ], for each ode v. 04 Goodrich, Tamassia, Goldwasser Uio-Fid Proof of lo* Amorized Time! For each ode v wih pare w: r v > r w! Claim: There are a mos / s odes of rak s.! Proof: Sice r v < r w, for ay ode v wih pare w, raks are moooically icreasi as we follow pare poiers up ay ree. Thus, if r v r w for wo odes v ad w, he he odes coued i v mus be separae ad disic from he odes coued i w. If a ode v is of rak s, he v s. Therefore, sice here are a mos odes oal, here ca be a mos / s ha are of rak s. 04 Goodrich, Tamassia, Goldwasser Uio-Fid

Uio-Fid //4 : Proof of lo* Amorized Time! Defiiio: Tower of wo s fucio: i i-! Nodes v ad u are i he same rak roup if lo*rv lo*ru:! Sice he lares rak is lo, he lares rak roup is lo*lo lo* - 04 Goodrich, Tamassia, Goldwasser Uio-Fid Proof of lo* Amorized Time 4! Chare cyber-dollar per poier hop duri a fid: If w is he roo or if w is i a differe rak roup ha v, he chare he fid operaio oe cyberdollar. Oherwise w is o a roo ad v ad w are i he same rak roup, chare he ode v oe cyberdollar.! Sice here are mos lo* - rak roups, his rule uaraees ha ay fid operaio is chared a mos lo* cyber-dollars. 04 Goodrich, Tamassia, Goldwasser Uio-Fid 4 7

Uio-Fid //4 : 04 Goodrich, Tamassia, Goldwasser Uio-Fid Proof of lo* Amorized Time! Afer we chare a ode v he v will e a ew pare, which is a ode hiher up i v s ree.! The rak of v s ew pare will be reaer ha he rak of v s old pare w.! Thus, ay ode v ca be chared a mos he umber of differe raks ha are i v s rak roup.! If v is i rak roup > 0, he v ca be chared a mos -- imes before v has a pare i a hiher rak roup ad from ha poi o, v will ever be chared aai. I oher words, he oal umber, C, of cyber-dollars ha ca ever be chared o odes ca be bouded by lo* C 04 Goodrich, Tamassia, Goldwasser Uio-Fid Proof of lo* Amorized Time ed! Boudi :! Reuri o C: 0 s s s s < + + + C lo* lo* lo* lo* <