Question: What does the following pseudocode? What is its complexity? (10 Points) 7 procedure mystery(a1,...,an: integers) abc = ai def: = 42 if a >athen begin

 What does the following pseudocode? What is its complexity? (10 Points)

What does the following pseudocode? What is its complexity? (10 Points) 7 procedure mystery(a1,...,an: integers) abc = ai def: = 42 if a >athen begin def := a1 abc : = 42 end for i:= 3 ton if a > abc then begin def: = abc abc : = end if (a; > def and a; sabc) then def. = a. return def It finds and returns the location of the largest integer in a list. It's complexity is O(n^2). 3 It finds and returns the second-largest integer in a list. It's complexity is O(n^2). It finds and returns the average of the largest and second-largest integers in a list. It's complexity is O(n^2). D It finds and returns the second-largest integer in a list. It's complexity is O(n). It finds and returns the average of the largest and second-largest integers in a list. It's complexity is O(n). T It finds and returns the location of the largest integer in a list. It's complexity is O(n)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!