This preview shows pages 1–2. Sign up to view the full content.
CSCI 4041: Algorithms and Data Structures
(Fall’09)
Homework 3, Due 11/10/09
Answer all of the following questions, and always explain your answer. Good Luck!
1. (30 points) This questions considers operations and properties of Binary Search Trees (BSTs):
(a) (15 points) Prove that no matter what node we start at in a height
h
BST,
k
successive calls to
TREESUCCESSOR will take
O
(
k
+
h
)
time.
(b) (15 points) Professor Tree thinks he has discovered a remarkable property of BSTs. Suppose
that the search for key
k
in a binary search tree ends up in a leaf. Consider three sets:
A
, the
keys to the left of the search path;
B
, the keys on the search path; and
C
, the keys to the right of
the search path. Professor Tree claims that any three keys
a
∈
A
,
b
∈
B
, and
c
∈
C
must satisfy
a
≤
b
≤
c
. Give a simple counterexample to the professor’s claim.
2. (40 points) Suppose you are taking
n
courses, each with a ﬁnal project that still needs to be completed.
Each project will be scored using an integer on a scale of
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.
 Spring '08
 karypis
 Algorithms, Binary Search, Data Structures

Click to edit the document details