1. This question concerns the dynamic programming algorithm for computing a binary tree, discussed in class...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. This question concerns the dynamic programming algorithm for computing a binary tree, discussed in class in and in the notes. Suppose we are given the following data, consisting of 8 key values and the frequency with which each key is accessed: i 1 2 3 4 5 6 7 8 Data Pi A B D E F G H 0.09 0.17 0.26 0.05 0.06 0.12 0.10 0.15 (a) For each i and j in the appropriate range, give the values of E[i, j] and root[i, j]. (b) Draw the optimal binary tree for the data given above. (c) What is the weighted lookup cost of the optimal binary tree? Explain briefly how you computed it. 1. This question concerns the dynamic programming algorithm for computing a binary tree, discussed in class in and in the notes. Suppose we are given the following data, consisting of 8 key values and the frequency with which each key is accessed: i 1 2 3 4 5 6 7 8 Data Pi A B D E F G H 0.09 0.17 0.26 0.05 0.06 0.12 0.10 0.15 (a) For each i and j in the appropriate range, give the values of E[i, j] and root[i, j]. (b) Draw the optimal binary tree for the data given above. (c) What is the weighted lookup cost of the optimal binary tree? Explain briefly how you computed it.
Expert Answer:
Answer rating: 100% (QA)
The image depicts a question which refers to a dynamic programming approach to create an optimal binary search tree BST given certain key frequencies In such a tree the cost of searching for a key is ... View the full answer
Related Book For
Probability and Random Processes With Applications to Signal Processing and Communications
ISBN: 978-0123869814
2nd edition
Authors: Scott Miller, Donald Childers
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
What is the coefficient of sliding friction and what is a representative value for this coefficient for the brittle crust?
-
In 2016, Skylar sold an apartment building for $20,000 cash and a $300,000 note due in two years. Skylar's cost of the property was $250,000, and he had deducted depreciation of $150,000, $60,000 of...
-
Paper is made from a suspension of fibers in water. The process begins by draining the fibers to a water-to-fiber ratio of 6:1, followed by pressing to a 2:1 ratio. What type of dryer could then be...
-
Sketch and describe helical and bevel gear and state applications of each.
-
Selected columns of Envirocon Companys payroll register for March are as follows. The employers Social Security tax amount has already been calculated as $ 3,124.34. The employees FICA Medicare tax...
-
Crane Corp. is thinking about opening a soccer camp in southern California. To start the camp, Crane would need to purchase land and build four soccer fields and a sleeping and dining facility to...
-
On july 1, 2009, Les Co. acquired 50,000 newly issued shares of Claypool Co. at 10 pesos per share. Before the acquisition, Claypool had 100,000 ordinary shares outstanding. In 2009, Claypool...
-
We have following data for a corporate bond: - Nominal value $100,000 - Semiannual coupon rate 5%. - Coupons are paid semiannually with redemption of face value at the end. - Maturity 3 years With...
-
Given the following: #includ int a[] {4,6}, i = 0, y =3, z=1; void f(int x){ } int z = 2; 9 0); x = x+y; Z = Z+X; i++; return x+a[i]+y; void g(){ z += 3; y=a[i] +z; } void main(){ } printf("%d",...
-
Objectives This assignment requires you to design and implement a Graphic User Interface (GUI) for the customers and products Order System (OS) by using Java Swing. Meanwhile, the file I/O and...
-
Clear company manufactures vacuum cleaners. Specializing in the market niche of "entry-level" vacuum cleaners, it is studying the launch of a more efficient model (referenced T1200) Activity...
-
Your brand is CANADIAN TIRE , where the annual report and other details of their strategy (e.g. online marketing strategy) is readily available via online resources. You will then compile 6 metrics...
-
For the time period between 2007 and 2009 people experienced dramatic declines in the market value of stocks, mutual funds, and other investments. Then, the market began to rebound. Based on the...
-
Recall that Chapter 8 described the binary search algorithm for finding a particular entry in an ordered list. The idea behind binary search is to begin looking in the exact center of the list. If...
-
Two random variables have a joint Gaussian PDF given by (a) Identify Ï2x, Ï2y, and ÏX, Y. (b) Find the marginal PDFs, f X (x) and f Y (y). (c) Find the conditional PDFs, f X| Y (x| y)...
-
The input to a linear filter is a random process with the following autocorrelation function: The impulse response of the filter is of the same form and is Determine the autocorrelation function of...
-
Define the generating functions (a) Show that Pi, j(z) = Fi, j(z) Pjj(z). (b) Prove that if state j is a transient state, then for all i, n=1
-
If someone is in the 22 percent marginal tax bracket, is that persons entire income taxed at 22 percent? Why or why not?
-
What are the major categories of adjustments to gross income? For a taxpayer in the 22 percent marginal tax bracket, how much would adjustments totaling $10,000 save in taxes?
-
Define net asset value. When is the net asset value of a mutual fund calculated?
Study smarter with the SolutionInn App