Course Solutions Uncategorized (Solved) : 5 Marks Looking Find Largest Algorithm Described Figure 214 Numbers List Unique Would Algo Q29502108 . . . .

(Solved) : 5 Marks Looking Find Largest Algorithm Described Figure 214 Numbers List Unique Would Algo Q29502108 . . . .

 

(5 marks) Looking at the Find LargestAlgorithm as described in figure 2.14, if the numbers in thelist were not unique, would the algorithm report the first or thelast occurrence of the largest number if it occurred several times?Explain your answer. 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

FIGURE

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post