This preview shows pages 1–2. Sign up to view the full content.
COP 3530
Assignment 10
Due: 6
th
Nov 2009
1.
Heightbiased Leftist trees.
Consider the following heightbiased max leftist tree. Show the modified
tree under each of the following operations. (Note: The two operations (a)
and (b) are independent. Each of them starts from the given tree.)
14
/ \
12
10
/ \
/ \
8
4
6
9
/
/
2
5
a.
Perform a
put
(7). Label each node of the resulting tree with its
s
value
(
shortest
(
x
)).
b.
Perform a
RemoveMax
() operation on the given tree above. Show each
step.
2
.
Tournament trees.
A ktournament is tree is a complete binary tree in which the winner of each
match moves up to occupy also the parent position. In a pointerbased
implementation, we have for each cell, pointers left [.] and right [.] to left
and right children, and a value [.].
Design an efficient algorithm for
merging two ktournament trees into a (k+1)tournament tree.
Justify your
algorithm’s time complexity.
3.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 01/15/2010 for the course COP 3530 taught by Professor Davis during the Fall '08 term at University of Florida.
 Fall '08
 Davis
 Algorithms, Data Structures

Click to edit the document details