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