{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw10Section1V2 - P two< word = 0.20(a Suppose we...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 331 Section 1 HW10 Spring 2008 Due noon Friday, 18 April Handin will call this HW11 (hw10 and hw12 are for Section 2) 1. Problem 10.1 on page 475 of the Weiss text. (multiprocessor scheduling) 2. (a) Do problem 10.3 on page 475 of the Weiss text. (Huffman coding) (b) Using your codebook, what string would encode “1736”? (c) What string would encode “4 5 9”? (blanks between the digits) 3. Problem 10.6 on page 476 of Weiss. (Huffman coding) 4. Problem 10.28 on page 478 Weiss. (Matrix multiplication) 5. Problem 10.29 on page 478 Weiss. (Matrix multiplication) 6. Suppose we need to implement a negative dictionary for a word processing application. Suppose that the dictionary contains only the words { in, no, two }. Also, suppose that the probabilities of words appearing in English are distributed as follows. P(word < in ) = 0.40; P(word = in ) = 0.05; P( in < word < no ) = 0.22; P(word = no )=0.01; P( no < word < two )=0.10; P(word = two ) = 0.02;
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: P( two < word) = 0.20. (a) Suppose we implement the negative dictionary via linear search of a list “with one big hole at the end for failed search” . Compute the expected cost of searching for any word in the list, sorted alphabetically, assuming that the cost of finding the first word is 1, the second word is 2, the third word is 3, and any word in the hole is 4. (b) What word order makes the expected linear search cost minimal? (c) Suppose we implement the negative dictionary as a binary search tree. There will now be 4 holes; represent each of them as a “failure node” in the tree. Give two different such search trees and compute the expected cost of searching each tree. Are their expected costs better than for the linear search in (b)? (d) Using either brute force search, or dynamic programming, find a binary search tree with the minimal expected cost of search. Is this optimal search tree a balanced tree?...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern