Question-53

Question -53

List all the steps used by Algorithm 1 to find the maximum of the list

5, 9, 13, 9, 11, 2, 16, 2, 14, 4

 

Solution

max = 5 ,  i = 2 ,

max = 9 , i = 3 ,

max = 13 , i = 4 , i = 5 , i = 6 , i = 7 ,

max = 16 , i = 8 , i = 9 , i= 10 , i = 11

 

 

Leave a Reply

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