Question & Answer: likely fastest, assuming N > 20? a. Perform N…..

ist. b. Sort the ist with selection sort, then perform N linear searches on e Sort the ist with selection sort, then perform N binary searches o d a and b are both fastest e. b and c are both fastest. 17. At most, how many parent classes may a Python class have? a. o b. 1 d. 1 per attribute. e. None of the above. For questions 18-22, refer to the following code: 1, 2. # weather.csv contains lines of the form datelowhig # for daily weather for some number of days 4 infle open(weather.csv, r) 5. results-ID.0.0 6. current ID. 0. 7. count-0 8. for line in infile: row_info - line.strip0.splitC) current[0].append(float(row_info[iD) currentll].append(float(row_infol2) current[2).append(float( count += 1 if count % 14 == 1: ow infol4 15. 16. results(0].append(min(currer results//1.append(max(curre results[2).append(sum(curr current = [[], [], []] 18. lnnnth of results[0], if L represents th Python

Assume we have a of 200N items. We need to perform N searches in Which course of events of likely fastest, assuming N > 20? a. Perform N linear searches on original, unsorted list. b. Sort the list with selection sort, then perform N linear searches on c. Sort the list with selection sort, then perform N binary searches on d. a and b are both fastest. e. b and c are both fastest. At most, how many parent classes may a Python class have? a. 0 b. 1 c. 2 d. 1 per attribute. e. None of the above. For questions 18-22, refer to the following code: 1. # weather.csv contains lines of the form date, low, 2. # for daily weather for some number of days 3. 4. infile = open(‘weather.csv’, ‘r’) 5. results = [[], [], []] 6. current = [[], [], []] 7. count = 0 8. for line in infile: 9. row_info = line.strip().split(‘,’) 10. current[0].append(float(row_info[1]) 11. current[1].append(float(row_info[2]) 12. current[2].append(float(row_info[4]) 13. count += 1 14. if count % 14 == 1: 15. results[0].append(min(current 16. results[1].append(max 17. results[2].append(sum 18. current = [[], [], []]

Expert Answer

 

Hi,

Below is the answer-

Ans 15 d) O(n2)

Ans 16 – b)sort the list with selection sort then perform N linear searches on original, unsorted list.

Ans 17 – d) 1 per attribute

Still stressed from student homework?
Get quality assistance from academic writers!