Consider the given alorithm where A(1:n) is an array of n integers... A) What does the program do? What are the interpretations of B and C? B) What is the EXACT number comparisons in the best case in...



Consider the given alorithm where A(1:n) is an array of n integers...


A) What does the program do? What are the interpretations of B and C?


B) What is the EXACT number comparisons in the best case in terms of n?


C) What is the EXACT number comparisons in the worst case in terms of n?


B+ A(1); C + A(1)<br>for i = 2 to n do<br>if A(i) > B then<br>B- A(i)<br>else<br>if A(i) < C then<br>C- A(i)<br>endif<br>endif<br>endfor<br>

Extracted text: B+ A(1); C + A(1) for i = 2 to n do if A(i) > B then B- A(i) else if A(i) < c="" then="" c-="" a(i)="" endif="" endif="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here