[Solved]10 Consider Mystery Algorithm Input A1 A2 N Length Sequence P Number Output 2 J Q37253912
this is discrete maths in computer science problems

10): Consider: Mystery Algorithm Input: a1, a2, …, an n, the length of the sequence p, a number Output:?2 While (i < j) While (i <j and ai < p) ii+1 End-while While (i < j and aj z p) End-while If (i < j), swap ai and aj End-while Return( a1, a2,…,an) Run the algorithm using the sequencee 6 And p 1 10 -9 8 10 10 -1 -2 -3 -5 What does the algorithm do to the sequence? Estimate the time complexity of the algorithm (note that in the sample sequence n-11) For eachsequence below, find the smallestinteger k such that thesequence is O(n*) verify your k works (ii). (a) Sn(2n1 (5n2 1) S, n.t tnwhere all we know is that tn-O( – O(nb) n) for some b > 0 Show transcribed image text 10): Consider: Mystery Algorithm Input: a1, a2, …, an n, the length of the sequence p, a number Output:?2 While (i
Expert Answer
Answer to 10): Consider: Mystery Algorithm Input: a1, a2, …, an n, the length of the sequence p, a number Output:?2 While (i < j... . . .
OR

