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]Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.