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.
18. Show that the tournament sort requires (3(n log n) comparisons to sort a list of n elements. [Hint: By iierting the appropriate number of dummy elements defined to be smaller than all integers, such as -z, assume that n = 2k for some positive integer k.]

Want to see the full answer?
Check out a sample textbook solution
Chapter 11 Solutions
DISCRETE MATH CONNECT ACCESS
- Consider the proof below: Proposition: If m is an even integer, then 5m +4 is an even integer. Proof: We see that |5m+4=10n+4 = 2(5n+2). Therefore, 5m+4 is an even integer. **Note: you may assume the proof is valid, just poorly written. Based upon the Section 1.3 screencast and the reading assignment, select all writing guidelines that are missing in the proof. Proof begins by stating assumptions ✓ Proof has an invitational tone/uses collective pronouns Proof is written in complete sentences Each step is justified ☐ Proof has a clear conclusionarrow_forwardNote: The purpose of this problem below is to use computational techniques (Excelspreadsheet, Matlab, R, Python, etc.) and code the dynamic programming ideas seen inclass. Please provide the numerical answer to the questions as well as a sample of yourwork (spreadsheet, code file, etc.).We consider an N-period binomial model with the following properties: N = 60, thecurrent stock price is S0 = 1000; on each period, the stock price increases by 0.5% whenit moves up and decreases by 0.3% when it moves down. The annual interest rate on themoney market is 5%. (Notice that this model is a CRR model, which means that thebinomial tree is recombining.)(a) Find the price at time t0 = 0 of a (European) call option with strike price K = 1040and maturity T = 1 year.(b) Find the price at time t0 = 0 of a (European) put option with strike price K = 1040and maturity T = 1 year.(c) We consider now, that you are at time t5 (i.e. after 5 periods, which represents 1month later). Assume that the stock…arrow_forward4. [-/1 Points] DETAILS MY NOTES SESSCALCET2 6.5.024. Find the approximations Tη, Mn, and S, to the integral computer algebra system.) ASK YOUR TEACHER PRACTICE ANOTHER 4 39 √ dx for n = 6 and 12. Then compute the corresponding errors ET, EM, and Es. (Round your answers to six decimal places. You may wish to use the sum command on a n Tn Mn Sp 6 12 n ET EM Es 6 12 What observations can you make? In particular, what happens to the errors when n is doubled? As n is doubled, ET and EM are decreased by a factor of about Need Help? Read It ' and Es is decreased by a factor of aboutarrow_forward
- 6. [-/1 Points] DETAILS MY NOTES SESSCALCET2 6.5.001. ASK YOUR TEACHER PRACTICE ANOTHER Let I = 4 f(x) dx, where f is the function whose graph is shown. = √ ² F(x 12 4 y f 1 2 (a) Use the graph to find L2, R2 and M2. 42 = R₂ = M₂ = 1 x 3 4arrow_forwardThe general solution X'=Ax is given. Discuss the nature of the solutions in a neighborhood of (0,0) -2-2 (²) |a) A = (23) X(A) = (₁ (fi)e* + (2 (2) eht -2-5arrow_forwardshow work in paperarrow_forward
- practice problem please help!arrow_forwardPlease ensure that all parts of the question are answered thoroughly and clearly. Include a diagram to help explain answers. Make sure the explanation is easy to follow. Would appreciate work done written on paper. Thank you.arrow_forwardFind a parameterization for a circle of radius 4 with center (-4,-6,-3) in a plane parallel to the yz plane. Write your parameterization so the y component includes a positive cosine.arrow_forward
- Using the method of joints, determine the force in each member of the truss shown. Summarize the results on a force summation diagram, and indicate whether each member is in tension or compression. You may want to try the "quick" method hod.16 8m T or C CD CE AB EF BF гид B 6m i force in CE only (change top force to 8kn) 8 KN 8kNarrow_forwardNo chatgpt pls will upvotearrow_forwardPlease ensure that all parts of the question are answered thoroughly and clearly. Include a diagram to help explain answers. Make sure the explanation is easy to follow. Would appreciate work done written on paper. Thank you.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





