Fall 2011CMSC 351: Homework 8Clyde KruskalDue at the start of class Wednesday, November 9, 2011.Problem 1.Illustrate the operation of radix sort on the following list of English words:ilk, elf, jig, leg, elk, fig, ill, gel, eke, egg, gig, ellProblem 2.Suppose that you are givennred andnblue water jugs, all of different shapesand sizes. All red jugs hold different amounts of water, as do all blue ones. Moreover,for every red jug, there is a blue jug that holds the same amount of water, and viceversa.It is your task to find a grouping of the jugs into pairs of red and blue jugs that holdthe same amount of water. To do so, you may perform the following operation: picka pair of jugs in which one is red and one is blue, fill the red jug with water, andthen pour the water into the blue jug. This operation will tell you whether the redor the blue jog can hold more water, or if they are of the same volume. Assume thatsuch a comparison takes one time unit. Your goal is to find an algorithm that makesa minimum number of comparisons to determine the grouping. Remember that you
This is the end of the preview.
access the rest of the document.
Analysis of algorithms, Clyde Kruskal, blue water jugs, red jugs