Question: Math 220 Discrete Math Section 1 Time: Due: R Apr 26 Calculator: OK Form R-2 of7 Tost 3 -Chapter 7 Notes: 77? 3) The tollowing
Math 220 Discrete Math Section 1 Time: Due: R Apr 26 Calculator: OK Form R-2 of7 Tost 3 -Chapter 7 Notes: 77? 3) The tollowing algorithm takes an unsorted list of positive integers, along returns the largest number, z, in the list such that either y orxs true. It returns 0 if no such exists. The algorithm assumes that the list size, n, is a power of 2 with n1 1 : integer xyMax(y.la return d else return 0 #process the left haltf 10 : 12: 13 # process the right half 15 : 16 17: 18: 19: if m> max # find the largest max mi 20: max = 2 21 : 22: return max 23 end xyMax i) What is the recurrence relation that counts the number of comparisons for this algorithm? (The critical steps are at lines 2, 3, and 19.) i) What is a good big-0 reference function for algorithm xyMax
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
