answer the question s of programming languages principles and practice

Accounting and Finance business and finance assignment help
March 13, 2023
Introduction to Management writing homework help
March 13, 2023

answer the question s of programming languages principles and practice

1. Consider a rooted binary tree, where each internal (intermediate) node has 2 children. Assume each node, in particular, the leaves, has a symbol or variable associated with it. For the edges from each node to its children, associate a value 1 to one edge, and a value 0 to the other edge. A special case of such trees is the Huffman tree, or Huffman coding tree. Another special case is binary decision trees. One goal is to determine the code or sequence of 0’s and 1’s that result when one traverses a path from the root to each leaf of the tree. Devise an algorithm, pseudo-code or source code to implement the generation of such root-toleaf codes, using each of the following approaches. (Hint: in case of difficulty handling the general case for arbitrary binary trees, try to first devise solutions for concrete examples of the weighted binary trees of depths 1, 2, 3, 4, 5, 6, 7, 8, and then try to tackle the general case). (Hint: use concepts and tools of procedures, functions and recursion to achieve modularity)

a. If, if-else statements, expressions

b. Case-switch statements, expressions

c. Guarded if, guarded do statements, commands

d. Attribute grammar based evaluation

4. Data types issues.

a. Devise two different data representations or (user defined) derived data types that can be used to facilitate the manipulation of weighted binary trees described above in Problem (1).

b. Use the representation schemes above to discuss how the following issues and concerns can be handled: data type equivalence, compatibility, checking, coercion, conversion. (Hint: consider issues that arise when the edge weights can be of different types of sets of values (data types), and they still need to be manipulated to generate the root-to-leaf code sequences).

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers