subject

Question 1: Consider the following two implementations of a function that if given a list, lst, create and return a new list containing the elements of lst in reverse order. def reverse1(lst): rev_lst = [] i = 0 while(i < len(lst)): rev_lst. insert(0, lst[i]) i += 1 return rev_lst def reverse2(lst): rev_lst = [] i = len(lst) - 1 while (i >= 0): rev_lst. append(lst[i]) i -= 1 return rev_lst If lst is a list of n integers, 1. What is the worst case running time of reverse1(lst)? Explain of your answer. 2. What is the worst case running time of reverse2(lst)? Explain of your answer.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 11:00
Describe three characteristics of at-risk drivers. a. b. c. describe three characteristics of safe drivers. a. b. c. describe three driver errors that could cause a collision. a. b. c. how will this information affect you as a driver now and in the future? (2-3 sentences)
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. a company is currently focusing on creating specific management goals for itself. which level of maturity is the company demonstrating under the sse_ccm framework? a. performed informally b. planned and tracked c. quantitatively controlled d. well-defined e. continuously improving
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
You know the right answer?
Question 1: Consider the following two implementations of a function that if given a list, lst, crea...
Questions
question
Social Studies, 29.06.2019 21:30
question
Social Studies, 29.06.2019 21:30
Questions on the website: 13722367