Two problem sets from a cs 542 quiz focusing on advanced data structures and algorithms. The first problem set deals with leftist heaps and their purge method, while the second problem set involves identifying the value of origin(find(s)) and an augmenting path in a graph using the edmonds-karp algorithm.
Download CS 542 Quiz 4: Leftist Heaps and Edmonds-Karp Algorithm and more Exercises Data Structures and Algorithms in PDF only on Docsity!
( 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/
( 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?