Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Choose one to answer. 1- Write an algorithm that can take a non-ordered list of

ID: 3735705 • Letter: C

Question

Choose one to answer.

1- Write an algorithm that can take a non-ordered list of input integers and return output list of values that occurred more than one.

2- Write an algorithm that can take a list of input integers and return the largest difference obtained from the integer in the list.

3- Write an algorithm that can accept an ordered list of input real numbers and find the location of the largest number in the list.

Explanation / Answer

2) def getLargest(list): max = list[0] #set first element as max for i in range(1, len(list)): #iterate from second element till the end of list if list[i] > max: #compare and updates max if found max = list[i] return max def getSmallest(list): min = list[0] #set first element as min for i in range(1, len(list)): #iterate from second element till the end of list if list[i]