This LEC mainly focuses on the Content of complexity, which is not well summarized, but the python section in itCodeMore interesting. Just paste it here.
Import pylab, mathdef showgrowth (lower, upper): log = [] Linear = [] quadratic = [] loglinear = [] exponential = [] for N in range (lower, upper + 1): log. append (math. log (n, 2) linear. append (n) loglinear. append (N * Math. log (n, 2) quadratic. append (N ** 2) exponential. append (2 ** N) pylab. plot (log, label = 'log') pylab. plot (linear, label = 'linear ') pylab. legend (loc = 'Upper left ') pylab. figure () pylab. plot (linear, label = 'linear ') pylab. plot (loglinear, label = 'Log linear ') pylab. legend (loc = 'Upper left ') pylab. figure () pylab. plot (loglinear, label = 'Log linear ') pylab. plot (quadratic, label = 'quadratic ') pylab. legend (loc = 'Upper left ') pylab. figure () pylab. plot (quadratic, label = 'quadratic ') pylab. plot (exponential, label = 'exponential') pylab. legend (loc = 'Upper left ') pylab. figure () pylab. plot (quadratic, label = 'quadratic ') pylab. plot (exponential, label = 'exponential') pylab. semilogy () pylab. legend (loc = 'Upper left ') returnshowgrowth (1, 1000) pylab. show ()