subject

Def find_max(nums: [int]) -> int: '''
Finds the maximum value in the given list of integers,
or None if the list is empty
'''
largest = None

for num in nums:
if largest == None or num > largest:
largest = num

return largest

Rewrite the find_max function so that it uses recursion to work its way through the list instead of using a loop. Your rewritten function should accept the same kinds of inputs (i. e., a one-dimensional list of integers) and generate the same outputs. In your view, is this a problem that's well-suited to a recursive solution in Python.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
question
Computers and Technology, 22.06.2019 14:00
What are procedures that keep a data base current
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
This is not a factor that you should use to determine the content of your presentation. your audience your goals your purpose your technology
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
You know the right answer?
Def find_max(nums: [int]) -> int: '''
Finds the maximum value in the given list of integer...
Questions
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
English, 18.09.2020 01:01
question
English, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Physics, 18.09.2020 01:01
question
History, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 01:01
question
Mathematics, 18.09.2020 02:01
question
Biology, 18.09.2020 02:01
question
Mathematics, 18.09.2020 02:01
question
Mathematics, 18.09.2020 02:01
question
English, 18.09.2020 02:01
question
Mathematics, 18.09.2020 02:01
question
Mathematics, 18.09.2020 02:01
Questions on the website: 13722363