Unformatted text preview:

CS 6363: Algorithm D esign and Analysis − Spring 2022Homework # 3 − D ue: March 22Professor D.T. HuynhProblem #1. Do Problem #15.5-1 in [CLRS], page 403.Problem #2. Generalize Huffman’s algorithm to ternary codewords (i.e. codewords using the symbols 0, 1, 2), and prove that it yields optimal ternary codes.Problem #3. (Coin changing)Consider the problem of making change for n cents using the least number of coins.1. Describe a greedy algorithm to make change consisting of quaters, dimes, nickels, an dpennies. Prove that your algorithm yields an optimal solution.2. Suppose that the available coins are in the denominations c0, c1, . . . , ckfor some integersc > 1 and k ≥ 1. Show that the greedy algorithm always yields an op timal solution.3. Give a set of coins denominations for which the greedy algorithm does not yield an optimalsolutionProblem #4. Do Problem # 16.4-5 in [CLRS], page 443.Problem #5. Do Problem # 21.2-2 [CLRS ], p . 567] and Problem # 21.3-1 [CLRS], p. 572].Problem #6. Give an efficient algorithm for computing th e tr an sition function δ for the string-matching automaton corresponding to a pattern P . Your algorithm should r un in time O(m|Σ|).(Hint. Prove that δ(q, a) = δ(π[q], a) if q = m or P [q + 1] 6= a.)Problem #7. Do Problem # 32.4-7 in [CLRS], page


View Full Document

UTD CE 6363 - Homework # 3

Documents in this Course
Load more
Download Homework # 3
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Homework # 3 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Homework # 3 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?