Docsity

CS 542 Quiz 4: Leftist Heaps and Edmonds-Karp Algorithm, Exercises of Data Structures and Algorithms

Toggle sidebar
bg1
- 1 -
1. (5 points) Consider a findmin operation on a leftist heap with lazy deletion that contains 50
deleted nodes. Findmin calls the purge method which returns a list of heaps. What is the
smallest number of heaps that can be in this list? What is the largest number?
Suppose we meld two leftist heaps, one with 25 internal nodes and another with 85. What is
the largest possible number of nodes, where the children must be swapped to maintain the
leftist property on the ranks?
CS 542 โ€“ Advanced Data Structures and Algorithms
Quiz 4
Jonathan Turner 3/21/2012
pf2

Partial preview of the text

Download CS 542 Quiz 4: Leftist Heaps and Edmonds-Karp Algorithm and more Exercises Data Structures and Algorithms in PDF only on Docsity!

  1. ( 5 points) Consider a findmin operation on a leftist heap with lazy deletion that contains 50 deleted nodes. Findmin calls the purge method which returns a list of heaps. What is the smallest number of heaps that can be in this list? What is the largest number? Suppose we meld two leftist heaps, one with 25 internal nodes and another with 85. What is the largest possible number of nodes, where the children must be swapped to maintain the leftist property on the ranks?

CS 542 โ€“ Advanced Data Structures and Algorithms

Quiz 4

Jonathan Turner 3/21/

  1. ( 5 points) The diagram below shows an intermediate state in the execution of the Edmonds- Karp algorithm for finding a matching in a graph (the partition data structure is not shown). In this state, what is the value of origin ( find ( s ))? If the edge { n,o } is processed next, the algorithm finds an augmenting path. What is that path?

+ a

c

b

d

e

g

i

h

j

k

m

o

n

p

x

s

u

t

v

w

  • โ€“

+ st^ +

ts

jd