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.
24. UseHuffmancodingtoencodethesesvmbo1siithgivenfrequencies:A:0.10.B:0.25,C:0.05.D: 0.15,E:0.30,F:0.07,G: 0.08. What is the average number of bits required to encode a symbol?
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
DISCRETE MATHEMATICS+ITS APPL. (LL)-W/A
- Section 2.2 Subsets 71 Exercise Set 2.2 Practice Exercises In Exercises 1-18, write or in each blank so that the resulting statement is true. 1. {1, 2, 5} {1, 2, 3, 4, 5, 6, 7} 2. {2, 3, 7} {1, 2, 3, 4, 5, 6, 7} 3. {-3, 0, 3} {-4,-3,-1, 1, 3, 4} 4. {-4, 0, 4} 5. {Monday, Friday} {-3, -1, 1, 3} {Saturday, Sunday, Monday, Tuesday, Wednesday} 6. {Mercury, Venus, Earth} {Venus, Earth, Mars, Jupiter} 7. {x/x is a cat} {xx is a black cat} {x|x is a pure-bred dog} ibrary mbers, ause the entire sual 8. {xx is a dog} 9. (c, o, n, v, e, r, s, a, t, i, o, n} {v, o, i, c, e, s, r, a, n, t, o, n} 10. [r, e, v, o, l, u, t, i, o, n} {t, o, l, o, v, e, r, u, i, n} 33. A = {x|x E N and 5 < x < 12} B = {x|x E N and 2 ≤ x ≤ 11} A_ B 34. A = {x|x = N and 3 < x < 10} B = A. {x|x = N and 2 ≤ x ≤ 8} B 35. Ø {7, 8, 9,..., 100} 36. Ø _{101, 102, 103, . . ., 200} 37. [7, 8, 9,...} 38. [101, 102, 103, ...} 39. Ø 40. { } { } e In Exercises 41-54, determine whether each statement is true or false. If…arrow_forwardA truck loaded with rocks weighs 14,260 lb. If the truck weighs 8420 lb, how much do the rocks weigh?arrow_forwardFind the lengths of r, s, t, and u shown in the figure below if r+s=34. Round your answers to the nearest tenth. Note that the figure is not drawn to scale. 16 37° r = S u = t S u 24 ☑arrow_forward
- Find the lengths of w, x, y, and z shown in the figure below if xy=69. Round your answers to the nearest tenth. Note that the figure is not drawn to scale. w= x= z= 16 37° W 24 Х Zarrow_forwardIn each of Problems 1 through 4, draw a direction field for the given differential equation. Based on the direction field, determine the behavior of y as t → ∞. If this behavior depends on the initial value of y at t = 0, describe the dependency.1. y′ = 3 − 2yarrow_forwardA = 5.8271 ± 0.1497 = B 1.77872 ± 0.01133 C=0.57729 ± 0.00908 1. Find the relative uncertainty of A, B, and C 2. Find A-3 3. Find 7B 4. Find A + B 5. Find A B-B - 6. Find A * B 7. Find C/B 8. Find 3/A 9. Find A 0.3B - 10. Find C/T 11. Find 1/√A 12. Find AB²arrow_forward
- B 2- The figure gives four points and some corresponding rays in the xy-plane. Which of the following is true? A B Angle COB is in standard position with initial ray OB and terminal ray OC. Angle COB is in standard position with initial ray OC and terminal ray OB. C Angle DOB is in standard position with initial ray OB and terminal ray OD. D Angle DOB is in standard position with initial ray OD and terminal ray OB.arrow_forwardtemperature in degrees Fahrenheit, n hours since midnight. 5. The temperature was recorded at several times during the day. Function T gives the Here is a graph for this function. To 29uis a. Describe the overall trend of temperature throughout the day. temperature (Fahrenheit) 40 50 50 60 60 70 5 10 15 20 25 time of day b. Based on the graph, did the temperature change more quickly between 10:00 a.m. and noon, or between 8:00 p.m. and 10:00 p.m.? Explain how you know. (From Unit 4, Lesson 7.) 6. Explain why this graph does not represent a function. (From Unit 4, Lesson 8.)arrow_forwardMake up two polynomial functions, f(x) and g(x). • f(x) should be of degree 3 or higher. g(x) should be of degree 4 or higher. • Find f(3) in each of the three ways: substitution, remainder theorem (synthetic division), and long division. You should get the same answer three times for f(3). Find g(-2) once using your choice of the three methods.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