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?
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
DISCRETE MATH
- Not use ai pleasearrow_forwardSolve the equation. Write the smaller answer first. 2 (x-6)² = 36 x = Α x = Previous Page Next Pagearrow_forwardWrite a quadratic equation in factored form that has solutions of x = 2 and x = = -3/5 ○ a) (x-2)(5x + 3) = 0 ○ b) (x + 2)(3x-5) = 0 O c) (x + 2)(5x -3) = 0 ○ d) (x-2)(3x + 5) = 0arrow_forward
- A vacant lot is being converted into a community garden. The garden and a walkway around its perimeter have an area of 690 square feet. Find the width of the walkway (x) if the garden measures 14 feet wide by 18 feet long. Write answer to 2 decimal places. (Write the number without units). Hint: add 2x to each of the garden dimensions of 14 x 18 feet to get the total area for the length multiplied by width.arrow_forwardSolve x-1 x+2 = 12 3 4 Your Answer: Answerarrow_forwardFind the solutions to the following equation 21x²+5x=6 ○ a) -3/7, 3/2 ☐ b) -2/3, 3/7 ○ c) -7/3, 3/2 ○ d) -2/3, 7/3arrow_forward
- Listen Solve the quadratic equation. Write the one solution, do not write x =. 2 x²+6x+9= 0 বarrow_forwardSolve the rational equation 14 1 + x-6 x x-7 x-7 ○ a) x = 1, x = 8 ○ b) x = 1 ○ c) x = 7 ○ d) x = 1, x = 7arrow_forwardSolve the absolute inequality | x + 5 > 3 ○ a) (-∞, -8] U[-2, ∞0) ☐ b) (-8, -2) c) (-2, ∞0) ○ d) (-∞, - 8) U(-2, ∞0)arrow_forward
- 1) Listen Describe the error in the problem X 3 X x 3 - 2 = 25x = 0 25x 25 x = ±5arrow_forwardnot use ai pleasearrow_forwardA falling object travels a distance given by the formula d = 6t + 7t² where d is in feet and t is the time in seconds. How many seconds will it take for the object to travel 115 feet? Round answer to 2 decimal places. (Write the number, not the units). Your Answer:arrow_forward
- Discrete Mathematics and Its Applications ( 8th I...MathISBN:9781259676512Author:Kenneth H RosenPublisher:McGraw-Hill EducationMathematics for Elementary Teachers with Activiti...MathISBN:9780134392790Author:Beckmann, SybillaPublisher:PEARSON
- Thinking Mathematically (7th Edition)MathISBN:9780134683713Author:Robert F. BlitzerPublisher:PEARSONDiscrete Mathematics With ApplicationsMathISBN:9781337694193Author:EPP, Susanna S.Publisher:Cengage Learning,Pathways To Math Literacy (looseleaf)MathISBN:9781259985607Author:David Sobecki Professor, Brian A. MercerPublisher:McGraw-Hill Education