Question: 1. Develop Pseudo-code ( English-like ) for: In the Find Largest pseudo-code algorithm of Figure 2.14, listed below, if the numbers in our list were

1. Develop Pseudo-code (English-like) for:

In the Find Largest pseudo-code algorithm of Figure 2.14, listed below, if the numbers in our list were not unique and therefore the largest number could occur more than once. Modify the algorithm below to find all the occurrences of the largest number and their position in the list.

 1. Develop Pseudo-code (English-like) for: In the Find Largest pseudo-code algorithm

FIGURE 2.14 Get a value for n, the size of the list Get values for A, Ag,A, the list to be searched Set the value of largest so farto A Set the value of location to 1 Set the value of i to 2 While (is n) do If A, >largest so far then Set largest so far to A, Set locationto 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!