Given a set of 10 letters { I, D, S, A, E, T, C, G, M, W }, answer the following: a) With the given letters above, we can construct a binary search tree (based on alphabetical ordering) and the sequence < C, D, A, G, M, I, W, T, S, E > is obtained by post-order traversing this tree. Construct and draw such a tree. NO steps of construction required. b) The letter S is first removed from the binary search tree determined above, followed by inserting a new letter R. Draw the updated binary search tree after removal and insertion. Choose the logical predecessor (not successor) of the removing node if necessary c) Determine and list the sequence of elements obtained by pre-order traversing the updated binary search tree after removal and insertion above. No steps required.
Given a set of 10 letters { I, D, S, A, E, T, C, G, M, W }, answer the following:
a) With the given letters above, we can construct a binary search tree (based on alphabetical ordering) and the sequence < C, D, A, G, M, I, W, T, S, E > is obtained by post-order traversing this tree. Construct and draw such a tree. NO steps of construction required.
b) The letter S is first removed from the binary search tree determined above, followed by inserting a new letter R. Draw the updated binary search tree after removal and insertion. Choose the logical predecessor (not successor) of the removing node if necessary
c) Determine and list the sequence of elements obtained by pre-order traversing the updated binary search tree after removal and insertion above. No steps required.
d) Suppose we are given the first six elements < I, D, S, A, E, T > and their frequencies of occurrence < 5, 6, 2, 4, 5, 2 >, construct and draw the Huffman Tree based on these elements above and their frequencies of occurrence as their weights. Clearly indicate the keys, the bit value in each edge, and the weight of each node in the tree as in our course material. NO steps of construction required.
Step by step
Solved in 3 steps with 5 images