Huffman tree and total number of unit time as asked in the given picture

  • Attachment 1
  • Attachment 2

Given the following set of character – probability pairs :"( C , 0 . 1 ) , ( D , 0 . 1 ) , ( R , 0 . 2 ) , ( 5 , 0 . 3 ) , ( E , 0 . 3 )( 2 ) Build a Huffman tree for this character set . Fill in the following table to show the queue L.which will start with the leaf nodes for the symbols , and the queue T, which will contain thesubtrees as they are built . Draw the tree shape for each subtree in T. Each row of the table mustshow the contents of the queues at the end of that step . ( Start by filling in the queue L contentsin the first line . ) The last step should have a single tree ( final Huffman tree ) in the queue T.( Ties in probability values are broken arbitrarily , and it doesn’t matter which dequeued node goesleft and which goes right when building a subtree. )StepQueue [Queue I

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following relations on the set {1, 2, 3}, list which of the five properties of relations (reflexive,irreflexive, symmetric, antisymmetric, transitive) each satisfies.

R = {(1, 2),(2, 3),(3, 1)}

S = {(1, 1),(2, 2),(3, 3)}

T = {(1, 2),(2, 1),(1, 3),(3, 1),(2, 3),(3, 2)}

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following recursive binary search algorithm for finding an element in a sorted array of integers:

int recursiveBinarySearch(int[] array, int target, int left, int right)

{

  if (left > right)    

return -1;

  int middle = (left + right) / 2; 

 if (array[middle] == target)

   return middle;  

if (array[middle] > target)

    return recursiveBinarySearch(array, target, left, middle – 1);  

return recursiveBinarySearch(array, target, middle + 1, right);

}

Assume n is the length of the array. Find the initial condition and recurrence equation that expresses the execution time for the worst case of this algorithm and then solve that recurrence.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

1.Given the following Pseudo Code, answer the questions below:  (5 points)

integer count = 0

integer max = 5

// allocate the array

integer numbers[max] 

while (count < max)

numbers[count] = count * 3

count = count + 2

endwhile

A.)What is the name of the array? __________________        B.)How many elements are in the array? ____ ___

At the end of the execution of the program:

C.)What is the value of count? __________________

D.)Draw a picture of the array and what it contains: 

2.Given the following Pseudo Code, answer the questions below:  (5 points)

integer index = 0

integer max = 7

// allocate the array

integer x[max]

while (index < max)

x[index] = index + 2

index = index + 3

endwhile

A.)What is the name of the array? __________________        B.)How many elements are in the array? ____ ___

At the end of the execution of the program:

C.)What is the value of count? __________________

D.)Draw a picture of the array and what it contains: 

14.Write a pseudocode declaration for a String array initialized with the following strings:”Einstein”, “Newton”, “Copernicus”, and “Kepler”.

15.Assume names in an Integer array with 20 elements. Design a For loop that displays each element of the array.16.Write a pseudocode algorithm that uses the For Each loop to display all of the values in the following array:Constant Integer SIZE = 10Declare Integer values [SIZE] = 1, 2,  3,  4,  5,  6,  7,  8,  9, 10

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following lambda expressions and corresponding interpretations:

  1. The interpretation of λf.λx.x is natural number 0 (zero). The interpretation of λf λx.(f (f. (… x ))), with n applications of f on x, is the natural number n >0.
  2. The interpretation of λn.λf.x(f ((n f) x )) is a successor function succ for natural numbers, where n is the formal parameter corresponding to the number whose successor is computed.
  3. The interpretation of λm.λn.((m succ) n) is the addition function add for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose sum is computed.
  4. The interpretation of λm.λn.((m add) n)) zero) is the multiplication function mul for two natural numbers, where m and n are the formal parameters corresponding to the numbers whose product is computed.
  5. The interpretation of λx.λy.x is propositional constant true.
  6. The interpretation of λx.λy.y is propositional constant false.

Identify the mathematical/logical interpretation for the following expressions. Justify your answer. (In

all these problems, apply the functions on some actual arguments and examine the results; does the

result correspond to some already known interpretation, e.g., true, false, zero, some natural numbers;

does their exist some mapping between interpretation of the result and the corresponding input.)

(a) λx.((x false) true), where x is the formal parameter corresponding to propositional constants.

(b) λn.((n λp.((p false) true)) true), where n is the formal parameter corresponding to natural numbers.

(c) λn.((n λx.λy.λz.z) true), where n is the formal parameter corresponding to natural numbers.

(d) λm.λn.((m (mul n)) (succ zero)), where m and n are formal parameters corresponding to natural numbers.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following while loop, what is the value of ‘sum’ after the 3rd time through the loop, at the point of the –HERE– listed below in the code?

int counter = 30;

int sum = 20;

while (counter >= 0) {

 counter++;

 sum = sum + counter -3;

  counter = counter – 3;

 // –HERE–

  if (sum <= counter) {

       sum = counter * 4;

   } else {

       sum = counter + 2;

}

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following two half-reactions, determine which overall reaction is spontaneous and calculate its standard cell potential.

Cd2+(aq) + 2 e- ® Cd(s) E° = -1.21 V

Sn2+(aq) + 2 e- ® Sn(s) E° = -0.14 V

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following two binary numbers: 11111100 and 01110000 Which of these two numbers is the larger unsigned binary number?

01110000

11110000

11111100

01110001

Question 2

1 pts

Given the following two binary numbers: 11111100 and 01110000 Which of these two is the larger when it is being interpreted on a computer using signed-two’s complement representation?

01110001

11110000

11111100

01110000

Question 3

1 pts

Given the following two binary numbers: 11111100 and 01110000 Which of these two is the smaller when it is being interpreted on a computer using signed-magnitude representation?

01110000

01110001

11111100

11110000

Question 4

1 pts

What decimal value does the 8-bit binary number 10110100 have if: it is interpreted as an unsigned number?

-75

180

-52

-76

53

Question 5

1 pts

What decimal value does the 8-bit binary number 10110100 have if: it is on a computer using signed-magnitude representation?

-52

180

-76

-75

53

Question 6

1 pts

What decimal value does the 8-bit binary number 10110100 have if: it is on a computer using one’s complement representation?

-75

-76

180

-52

53

Question 7

1 pts

What decimal value does the 8-bit binary number 10110100 have if: it is on a computer using two’s complement representation?

180

-76

-75

53

-52

Question 8

1 pts

What decimal value does the 8-bit binary number 10110100 have if: it is on a computer using excess-127 representation?

-75

-76

180

53

-52

Question 9

1 pts

Add the following unsigned binary number as shown.

01000100 +  

10111011

—————-

10110111

11111111

10110001

10110011

Question 10

1 pts

Subtract the following signed binary numbers as shown using 2’s complement arithmetic.

    11000100 

– 00111011

——————-

10110011

10001001

10110001

10110111

Question 11

1 pts

Perform the following binary multiplication, assuming unsigned integers:

1011

X 101

——-

1110010

1011010

1000011

00110111

Flag this Question

Question 12

1 pts

Perform the following binary divisions, assuming unsigned integers:

11111101/1011

11000

11010

11011

00111

Flag this Question

Question 13

1 pts

Show how the following floating point values would be stored using IEEE-754 double precision (be sure to indicate the sign bit, the exponent, and the significand fields):  it is 12.5

0 11000000010 1001000…0

0 10000000010 1001000…0

0 10000000010 1101000…0

0 10000000010 1001100…0

Flag this Question

Question 14

1 pts

Show how the following floating point values would be stored using IEEE-754 double precision (be sure to indicate the sign bit, the exponent, and the significand fields):  it is -1. 5

1 01111111111 1000000…0

0 11000000010 1001000…0

0 10000000010 1001000…0

0 10000000010 1001100…0

Flag this Question

Question 15

2 pts

Show how the following floating point values would be stored using IEEE-754 double precision (be sure to indicate the sign bit, the exponent, and the significand fields): it is .75

0 11000000010 1001000…0

0 10000000010 1001000…0

0 10000000010 1001100…0

0 01111111110 1000000…0

Flag this Question

Question 16

2 pts

Show how the following floating point values would be stored using IEEE-754 double precision (be sure to indicate the sign bit, the exponent, and the significand fields): it is 26.265

0 10000000010 1001000…0

0 11000000010 1001000…0

0 10000000010 1101000…0

0 10000000011 1010101…0

Flag this Question

Question 17

2 pts

The ASCII code for the letter A is 1000001, and the ASCII code for the letter a is 1100001. Given that the ASCII code for the letter G is 1000111, without looking at Table 2.7, what isthe ASCII code for the letter g?

1100111

1001000

1101000

1001100

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the following total-revenue function_TR=9Q-Q2Derive the total-revenue, average revenue, and marginal revenue schedules from Q=0 to Q=4 by 1s.Average revenue(AR)=total revenue(TR)/QMarginal revenue(MR)=change in total revenue/change in QMR74

Given the following total­revenue function_TR=9Q­Q2Derive the total­revenue, average revenue, and marginal revenue schedules from Q=0 to Q=4 by 1s.Answer:AR = TR/Q = 9­QMR = dTR/dQ =…

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Given the guidelines presented I this chapter, identify flaws in the design of the report of the customers shown. What assumptions about users and tasks did you make in order to asses this design? Redesign this report to correct these flaws.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW