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

Info iconThis 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;
Background 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

This note was uploaded on 07/25/2008 for the course CSE 331 taught by Professor M.mccullen during the Spring '08 term at Michigan State University.

Ask a homework question - tutors are online