8️⃣

15.8 Practice

Practice

Practice 1

Label the running time of each line (use comment) of the template code in Big-O in terms of the input, and at the end (use comment) put the running time of the whole program in Big-O in terms of the input. The input of the problem is ex_list, and assume it has n elements. The first two lines will be done for you as an example.

Practice 2

Label the running time of each line(use comment) of the following code in Big-O in terms of the input, and at the end(use comment) put the running time of the whole program in Big-O in terms of the input. The input of the problem is ex_list, and assume it has n elements. The first two lines will be done for you as an example. Hint: Tricky case.

Practice 3

Label the running time of each line(use comment) of the following code in Big-O in terms of the input, and at the end(use comment) put the running time of the whole program in Big-O in terms of the input. The input of the problem is ex_list, and assume it has n elements. The first two lines will be done for you as an example.

Practice 4

Label the running time of each line(use comment) of the following code in Big-O in terms of the input, and at the end(use comment) put the running time of the whole program in Big-O in terms of the input. The input of the problem is ex_list, and assume it has n elements. The first two lines will be done for you as an example. Note: You will be surprised!

Practice 5

Label the running time of each line(use comment) of the following code in Big-O in terms of the input, and at the end(use comment) put the running time of the whole program in Big-O in terms of the input. The input of the problem is ex_list, and assume it has n elements. The first two lines will be done for you as an example. This problem assumes you have knowledge of 2D Lists.

⚖️

Copyright © 2021 Code 4 Tomorrow. All rights reserved. The code in this course is licensed under the MIT License. If you would like to use content from any of our courses, you must obtain our explicit written permission and provide credit. Please contact classes@code4tomorrow.org for inquiries.