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.
14. Use the tournament sort to sort the list 17, 4, 1, 5, 13, 10, 14, 6.
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
DISCRETE MATH CONNECT ACCESS
- Explain why lim x²-2x-35 X-7 X-7 lim (x+5), and then evaluate lim X-7 x² -2x-35 x-7 x-7 Choose the correct answer below. A. x²-2x-35 The limits lim X-7 X-7 and lim (x+5) equal the same number when evaluated using X-7 direct substitution. B. Since each limit approaches 7, it follows that the limits are equal. C. The numerator of the expression X-2x-35 X-7 simplifies to x + 5 for all x, so the limits are equal. D. Since x²-2x-35 X-7 = x + 5 whenever x 7, it follows that the two expressions evaluate to the same number as x approaches 7. Now evaluate the limit. x²-2x-35 lim X-7 X-7 = (Simplify your answer.)arrow_forwardA function f is even if f(x) = f(x) for all x in the domain of f. If f is even, with lim f(x) = 4 and x-6+ lim f(x)=-3, find the following limits. X-6 a. lim f(x) b. +9-←x lim f(x) X-6 a. lim f(x)= +9-←x (Simplify your answer.) b. lim f(x)= X→-6 (Simplify your answer.) ...arrow_forwardEvaluate the following limit. lim X-X (10+19) Select the correct answer below and, if necessary, fill in the answer box within your choice. 10 A. lim 10+ = 2 ☐ (Type an integer or a simplified fraction.) X-∞ B. The limit does not exist.arrow_forward
- Find the following limit or state that it does not exist. x² +x-20 lim x-4 x-4 Select the correct choice below and, if necessary, fill in the answer box to complete your choice. A. lim x²+x-20 x-4 (Type an exact answer.) x→4 B. The limit does not exist.arrow_forwardDetermine the intervals on which the following function is continuous. f(x) = x - 5x + 6 2 X-9 On what interval(s) is f continuous? (Simplify your answer. Type your answer in interval notation. Use a comma to separate answers as needed.)arrow_forwardFind the following limit or state that it does not exist. 2 3x² +7x+2 lim X-2 6x-8 Select the correct choice below and, if necessary, fill in the answer box to complete your choice. A. lim 3x²+7x+2 6x-8 (Simplify your answer.) X-2 B. The limit does not exist.arrow_forward
- Find the following limit or state that it does not exist. X-2 lim x-2 5x+6 - 4 Select the correct choice below and, if necessary, fill in the answer box to complete your choice. O A. lim X-2 X-2 15x+6 = (Type an exact answer.) - 4 B. The limit does not exist.arrow_forward(a) Sketch the graph of a function that is not continuous at 1, but is defined at 1. (b) Sketch the graph of a function that is not continuous at 1, but has a limit at 1. (a) Which of the following graphs shows a function that is not continuous at 1, but is defined at 1. ○ A. Ay ✓ B. 5 X ✓ (b) Which of the following graphs shows a function that is not continuous at 1, but has a limit at 1. ○ A. B. X y 5- -5 5 ✓ ✓ 5 ☑ 5 X y ☑ LVarrow_forwardIf lim f(x)=L and lim f(x) = M, where L and M are finite real numbers, then what must be true about L x-a x-a+ and M in order for lim f(x) to exist? x-a Choose the correct answer below. A. L = M B. LMarrow_forward
- Determine the following limit, using ∞ or - ∞ when appropriate, or state that it does not exist. lim csc 0 Select the correct choice below, and fill in the answer box if necessary. lim csc 0 = ○ A. 0→⭑ B. The limit does not exist and is neither ∞ nor - ∞.arrow_forwardQ1: For, 0 <|z| < 1, evaluate the following integral where g is analyfunction inside and on the unit circle C: α) δε a) Sc 15 αξί b) Sc 9(5) -1/2 d. -2 1.'s integrale عناarrow_forwardQ4: State the Fundamental Theorem of Independent of Path and Morera's Theorem. Why can't apply these theorems to compute the integral contour. zdz, where C is closedarrow_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