Pages

Monday 3 October 2011

cs301 old assignmnet


Problems
Question 1:

Make an AVL tree for the following input.
79, 47, 76, 53, 75, 56, 90, 48, 63, 59
Show all the necessary rotations where possible


 

Question 2:

Consider the following AVL tree.

  • Show the tree after deleting the node 80.
  • Show the AVL tree after deleting the node 50.
  • Show the AVL tree after inserting the node 79.

Question 3:
Given Letters A, B, C, D, E with following frequencies.
                                                                            
                                           Frequency Table

                   Character      Frequency     Huffman Codes
                            A        20                   -----------------
                              B         11                   -----------------
                              C         8                     -----------------
                              D         12                   -----------------
                              E         49                   -----------------

A) Create a Huffman tree to determine the binary codes for each character.
          B) Fill the codes into the table above.
          C) Encode the following sequence ABCDE.