Question: (5 marks) Looking at the Find Largest Algorithm as described in figure 2.14, if the numbers in the list were not unique, would the algorithm

(5 marks) Looking at the Find Largest Algorithm as described in figure 2.14, if the numbers in the list were not unique, would the algorithm report the first or the last occurrence of the largest number if it occurred several times? Explain your answer. (5 marks) Looking at the Find Largest Algorithm as described in figure

FIGURE 2.14 Get a value for n, the size of the list Get values for A, AA the list to be searched Set the value of largest so far to Set the value of location to 1 Set the value of i to2 While (is n) do If A, > largest so far then Set largest so far to A Set location to i Add 1 to the value ofi End of the loop Print out the values of largest so far and location Stop Algorithm to find the largest value in a list

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!