# sol1 - rectangle connecting a point left of or at x and a...

This preview shows page 1. Sign up to view the full content.

6.851 Advanced Data Structures (Spring’10) Prof. Erik Demaine Dr. Andr´ e Schulz TA: Aleksandar Zlateski Problem 1 Sample Solutions Transposing a matrix. Consider a point set { ( x i ,i ) } of k 2 points on a k 2 × k 2 lattice representing the access sequence. For each point ( x i ,i ) we introduce three new points at ( x i - 1 ,i ), ( k ± x i k ² ,i ) and ( k ³ x i k ´ ,i ) . The newly formed set is Aborally Satisﬁed , hence it represents a valid BST execution. The set contains O ( k 2 ), giving amortized cost of O (1) per access. Logarithmic redux. Consider the access sequence, the point set X = { ( x i ,i ) } of m points on a n × m lattice. Let ˆ x be the median of all x X . Inserting m points (ˆ x,i ) will ensure that each
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rectangle connecting a point left of or at x and a point right of or at x contains a point. Now consider the two subsets of X , X x x and X x x , each with at most m points, and at most n 2 distinct x values. We recursively apply the same technique, to obtained point set that is Aborally Satised . We get the number of newly inserted points by solving the recursion N ( m, n 2 ) = 2 N ( m, n 2 ,n ) + m . The total number of accesses is then O ( N ( m,n ) + m ) = O ( m log n + m ) = O ( m log n ). 1...
View Full Document

## This note was uploaded on 01/20/2012 for the course CS 6.849 taught by Professor Erikdemaine during the Fall '10 term at MIT.

Ask a homework question - tutors are online