ADSA

Homework 1

Google Colab and Python

Learn to plot functions

Read sections 3.1 and 3.2 from CLRS

Please read this with the goal of using the knowledge to do the homework below.

Watch the recorded lectures

Question 1

Reorder the following terms from lowest to highest time complexity, using < between terms. If two terms have the same complexity, use an equal sign instead. Assume n>1 and k is a constant.

Question 2 (CLRS 3.1-3)

Question 3 (CLRS 3.1-4)

Question 4 (From CLRS 3-3(a))

Rank the following functions by order of growth and describe how you obtained the ranking; i.e. find an arrangement g1, g2, …, gN of the functions satisfying g1 = Ω(g2), g2 = Ω(g3), …, gn-1 = Ω(gN). Also discuss which of the functions are equivalent (by reducing whichever ones can be reduced). Hint: Besides the mathematical analysis, two additional techniques that you MAY use to determine the growth are: (a) plotting the functions, and (b) timing the execution of the functions as shown here.

Help: