The tournament sort is a sorting algorithm that works by building an ordered binary tree. We represent the elements to be sorted by vertices that sill become the leaves. We build up the tree one level at a time we would construct the tree representing the winners of matches in a tournament Working left to right, we compare pairs of consecutive elements, adding a parent vertex labeled with the larger of the two elements under comparison. We make similar comparisons between labels of vertices at each level until we reach the root of the tree that is labeled with the largest element. The tree constructed by the tournament sort of , 8.14,17,3,9,27,11 is ilinstrated in part(a)ef the figure. Once the argestelementhbeendetermined. The leaf with this labelisrelabeled by -s,which is definedtobelessthanevery element The labels of all vertices on the path from this vertex up to the root of the tree are recalculated, as shown in part (b) of the figure.
This produces the second largest element This process continues until the entire list has been sorted.
26.
a) Use Huan coding to encode these symbols with frequencies a: 04, b: 0.2, C: 0.2, d 0.1, e: 0.1 in two different ways by breaking ties inthe aorithmdifferenUy, First. among the trees of minimum weight select two trees with the largest ntunberof vertices to
combineateachstageoftheaorithni Second, amongthe trees of mmimmweightselectreeswiththesmaflestnumberof
vertices at each stage.
b) Compute the average number of bits required to encode a symbol with each code and compute the variances of this number of bits for each code. Which tie-breaking procedure produced the smaller variance in the number of bits required to encode a symbol?
![Check Mark](/static/check-mark.png)
Want to see the full answer?
Check out a sample textbook solution![Blurred answer](/static/blurred-answer.jpg)
Chapter 11 Solutions
DISCRETE MATHEMATICS LOOSELEAF
- In the first row of the table you can see the given characters, in the second, you can see how often the letter appeared in the text.Task: Create an optimal huffman tree, using the table.arrow_forwardHow would I complete this with the tree diagram?arrow_forwardPlease use a tree diagram!arrow_forward
- Draw an ordered stemplot of these scores: 22, 32, 34, 30, 28, 19, 26, 18, 19, 20. List the 'leaves' on the second row in this stemplot in their correct order.arrow_forwardIvan plays four field tennis matches. Build a tree diagram to indicate the possible mbinations of matches won and lost matches Ivan can have in all four matches.arrow_forwardComplete the tree diagram by filling in the missing entries below.arrow_forward
- Use the critical path algorithm to create a priority list for the digraph below. T1 (2) T4 (12) Т6 (5) End T2 (7) T5 (4) T7 (11) Т3 (9) Priority list: Give the priority as a list of task numbers. For example, you'd enter something like: 1,2,3,4,5,6,7,8,9,10arrow_forwardThis is also about graph theory but with the nearest algorithmarrow_forwardFor a full 5-ary tree: (a) find the total number of vertices and (b) leaves when there are 7 internal vertices.arrow_forward
- Linear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9781285463247/9781285463247_smallCoverImage.gif)