MIT6_851S10_lec16

MIT6_851S10_lec16 - 6.897: Advanced Data Structures Spring...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6.897: Advanced Data Structures Spring 2007 Lecture Feb 21, 2007 Prof. Erik Demaine 1 Overview In the last lecture we worked in a BST model. We discussed Wilber lower bounds for BSTs for a particular access sequence, and developed Tango trees which achieve O (lg lg n )-competitiveness. This is a very promising result that gives hope for existence of a dynamically optimal tree. In this lecture we discuss dynamic trees that have many applications such as to Network Flow and Dynamic Connectivity problems in addition to them being interesting theoretically. This is the beginning of our discussion of dynamic graphs. We will discuss one data structure called Link-Cut trees that achieves logarithmic amortized time for all operations. 2 Dynamic Trees The dynamic tree problem we will discuss today is to represent a forest of rooted trees whose each node has an arbitrary number of unordered child nodes. The data structure has to support the following operations: MAKE TREE() Returns a new vertex in a singleton tree. This operation allows us to add elements and later manipulate them. LINK(v,w) Makes vertex v a new child of vertex w , i.e. adds an edge ( v, w ). In order for the representation to remain valid this operation assumes that v is the root of its tree and that v and w are nodes of distinct trees. CUT(v) Deletes the edge between vertex v and its parent, parent ( v ) where v is not the root. FIND ROOT(v) Returns the root of the tree that vertex v is a node of. This operation is interesting because path to root can be very long. The operation can be used to determine if two nodes u and v are connected. It is also possible to augment the data structure to return statistics about the path from the v to the root of its tree, such as the sum or minimum of the weights of each edge. This augmentation is necessary in flow algorithms. 3 Link-Cut Trees Link-Cut Trees were developed by Sleator and Tarjan [1] [2]. They achieve logarithmic amortized cost per operation for all operations. Link-Cut Trees are similar to Tango trees in that they 1 16
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
use the notions of preferred child and preferred path. The also use splay trees for the internal representation. 3.1 Defnition oF Link-Cut Trees We say a vertex has been accessed if was passed to any of the operations from above as an argument. We call represented trees the abstract trees that the data structure represents. We are not allowed to change the represented tree and it can be unbalanced. The represented tree is split into paths (in the data structure representation). The preferred child of node v is equal to its i -th child if the last access within v ’s subtree was in the i -th subtree and it is equal to null if the last access within v ’s subtree was to v itself or if there were no accesses to v ’s subtree at all. A preferred edge is an edge between a preferred child and its parent. A preferred path is a maximal continuous path of preferred edges in a tree, or a single
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/31/2011 for the course EECS 6.851 taught by Professor Erikdemaine during the Spring '10 term at MIT.

Page1 / 8

MIT6_851S10_lec16 - 6.897: Advanced Data Structures Spring...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online