Docsity

Partition Algorithm - Advanced Data Structures and Algorithms - Quiz, Exercises of Data Structures and Algorithms

Toggle sidebar
bg1
CS 542 – Advanced Data Structures and Algorithms
Quiz 3
J
onathan Turne
r
3/2/2010
1. (5 points) In the basic analysis of the partition algorithm, a node x is said to be dominant if
Δ(x) is more than twice Δ(y) for all ancestors y of x. In the tree shown below, which nodes
are dominant?
a
c
b
d
e
rank
1
8
9
12
13
- 1 -
pf2

Partial preview of the text

Download Partition Algorithm - Advanced Data Structures and Algorithms - Quiz and more Exercises Data Structures and Algorithms in PDF only on Docsity!

CS 542 – Advanced Data Structures and Algorithms

Quiz 3

Jonathan Turner 3/2/

  1. (5 points) In the basic analysis of the partition algorithm, a node x is said to be dominant if

Δ( x ) is more than twice Δ( y ) for all ancestors y of x. In the tree shown below, which nodes are dominant?

a

c

b

d

e

rank

  1. (5 points) Consider a depth-first search in the tree shown below, assuming that at each vertex, the children are visited in “left-to-right” order. Suppose that the search has reached node k but has not yet returned.

List the nodes that are open:

List the nodes that are closed:

What is the nearest open ancestor of node h?

a

c

b

d

e

f h

j

k

m n

r

p